From bd5ffa9f460467d6395d3140b5050441353c8a77 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 22 Jan 2023 01:08:49 +0100 Subject: [PATCH] Integrated the project router into the index.ts --- src/routes/v1/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/routes/v1/index.ts b/src/routes/v1/index.ts index e464f7e..571199b 100644 --- a/src/routes/v1/index.ts +++ b/src/routes/v1/index.ts @@ -1,7 +1,9 @@ import express, {Request, Response, Router} from "express"; import {sendError} from "@utils/error"; +import { authenticate } from "@middlewares/auth"; import authRoutes from "./auth"; import accountRoutes from "./account"; +import projectRoutes from "./project"; const app: Router = express.Router(); @@ -9,7 +11,11 @@ const app: Router = express.Router(); app.use("/auth", authRoutes); app.use("/user", accountRoutes); + // 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"));