add auth and user handling
This commit is contained in:
parent
db057ce342
commit
1fce467571
19 changed files with 356 additions and 32 deletions
12
src/index.ts
12
src/index.ts
|
|
@ -2,9 +2,9 @@ import { AppDataSource } from "./data-source"
|
|||
import * as express from "express";
|
||||
import * as dotenv from "dotenv";
|
||||
import { Request, Response } from "express";
|
||||
import { authPoint } from "./endpoints/authPoint";
|
||||
import { userPoint } from "./endpoints/userPoint";
|
||||
import { recipePoint } from "./endpoints/recipePoint";
|
||||
import authRoutes from "./endpoints/AuthPoint"
|
||||
import userRoutes from "./endpoints/UserPoint";
|
||||
//import { recipePoint } from "./endpoints/RecipePoint";
|
||||
import {errorHandler} from "./middleware/errorHandler"
|
||||
import "reflect-metadata";
|
||||
dotenv.config();
|
||||
|
|
@ -16,9 +16,9 @@ app.use(errorHandler);
|
|||
const PORT = process.env.PORT ? parseInt(process.env.PORT) : 4000;
|
||||
const HOST = process.env.HOST || "localhost";
|
||||
|
||||
app.use("/auth", authPoint);
|
||||
app.use("/user", userPoint);
|
||||
app.use("/recipe", recipePoint);
|
||||
app.use("/auth", authRoutes);
|
||||
app.use("/user", userRoutes);
|
||||
//app.use("/recipe", recipePoint);
|
||||
|
||||
app.get("*", (req: Request, res: Response) => {
|
||||
res.status(505).json({ message: "Bad Request" });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue