-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.js
More file actions
26 lines (20 loc) · 637 Bytes
/
Copy pathapi.js
File metadata and controls
26 lines (20 loc) · 637 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import express from "express";
const router = express.Router();
import { NOT_FOUND, OK } from "./constants/status.constants.js";
// Routes and Authorizations
import authRoutes from "./routes/auth.routes.js";
// Routes
// Health Check route, used for monitoring
router.use("/health", (req, res) => {
return res.sendStatus(OK);
});
// Auth Routes
router.use("/auth", authRoutes);
// Undefined Routes
router.route("*").all((req, res) => {
return res.status(NOT_FOUND).json({
success: false,
message: "Oops, you have reached an undefined route, please check your request and try again",
});
});
export default router;