Integrated both routes into the v1 index.ts
This commit is contained in:
parent
2bae7005e5
commit
db8fec5849
@ -1,8 +1,16 @@
|
|||||||
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 authRoutes from "./auth";
|
||||||
|
import accountRoutes from "./account";
|
||||||
|
|
||||||
const app: Router = express.Router();
|
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"));
|
app.use("*", (req: Request, res: Response) => sendError(res, 404, 0, "The provided route could not be found"));
|
||||||
|
|
||||||
export default app;
|
export default app;
|
Loading…
x
Reference in New Issue
Block a user