From db8fec58492ce09e5ba26f707437759090e3934b Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 15 Jan 2023 19:44:31 +0100 Subject: [PATCH] Integrated both routes into the v1 index.ts --- src/routes/v1/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/routes/v1/index.ts b/src/routes/v1/index.ts index e30d704..e464f7e 100644 --- a/src/routes/v1/index.ts +++ b/src/routes/v1/index.ts @@ -1,8 +1,16 @@ import express, {Request, Response, Router} from "express"; import {sendError} from "@utils/error"; +import authRoutes from "./auth"; +import accountRoutes from "./account"; const app: Router = express.Router(); +// Middlewares that don't require authentication +app.use("/auth", authRoutes); +app.use("/user", accountRoutes); + +// Middlewares that require authentication + app.use("*", (req: Request, res: Response) => sendError(res, 404, 0, "The provided route could not be found")); export default app; \ No newline at end of file