Integrated the project router into the index.ts
This commit is contained in:
parent
599f8ec73a
commit
bd5ffa9f46
@ -1,7 +1,9 @@
|
|||||||
import express, {Request, Response, Router} from "express";
|
import express, {Request, Response, Router} from "express";
|
||||||
import {sendError} from "@utils/error";
|
import {sendError} from "@utils/error";
|
||||||
|
import { authenticate } from "@middlewares/auth";
|
||||||
import authRoutes from "./auth";
|
import authRoutes from "./auth";
|
||||||
import accountRoutes from "./account";
|
import accountRoutes from "./account";
|
||||||
|
import projectRoutes from "./project";
|
||||||
|
|
||||||
const app: Router = express.Router();
|
const app: Router = express.Router();
|
||||||
|
|
||||||
@ -9,7 +11,11 @@ const app: Router = express.Router();
|
|||||||
app.use("/auth", authRoutes);
|
app.use("/auth", authRoutes);
|
||||||
app.use("/user", accountRoutes);
|
app.use("/user", accountRoutes);
|
||||||
|
|
||||||
|
|
||||||
// Middlewares that require authentication
|
// Middlewares that require authentication
|
||||||
|
app.use(authenticate);
|
||||||
|
|
||||||
|
app.use("/project", projectRoutes);
|
||||||
|
|
||||||
app.use("*", (req: Request, res: Response) => sendError(res, 404, 0, "The provided route could not be found"));
|
app.use("*", (req: Request, res: Response) => sendError(res, 404, 0, "The provided route could not be found"));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user