Refactor backend
This commit is contained in:
parent
fd497c0e23
commit
7027feb8ac
20 changed files with 75 additions and 369 deletions
28
lib/routes/router.js
Normal file
28
lib/routes/router.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Imports
|
||||
import express from "express";
|
||||
|
||||
// Routes
|
||||
import results from "../routes/results-route.js";
|
||||
import alerting from "../routes/alerting-route.js";
|
||||
import react from "../routes/react-route.js";
|
||||
import catalog from "../routes/catalog-route.js";
|
||||
|
||||
import buildDevRoute from "../routes/dev-route.js";
|
||||
|
||||
export default function buildRoutes(pg, skio) {
|
||||
const router = express.Router();
|
||||
// Special Routes
|
||||
router.all("/", (req, res) => res.redirect("/qualiteer"));
|
||||
if (process.env.USE_DEV_ROUTER === "true")
|
||||
router.use("/api/dev", buildDevRoute(pg, skio));
|
||||
|
||||
// Middlewares
|
||||
|
||||
// Routes
|
||||
router.use(react); // Static Build Route
|
||||
router.use("/api/results", results);
|
||||
router.use("/api/alerting", alerting);
|
||||
router.use("/api/catalog", catalog);
|
||||
|
||||
return router;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue