2022-07-12 21:26:36 +00:00
|
|
|
// Imports
|
|
|
|
import express from "express";
|
|
|
|
|
|
|
|
// Routes
|
2022-10-08 17:47:46 +00:00
|
|
|
import vitals from "../routes/vitals-route.js";
|
2022-07-12 21:26:36 +00:00
|
|
|
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
|
2022-10-08 17:47:46 +00:00
|
|
|
router.use(vitals);
|
2022-07-12 21:26:36 +00:00
|
|
|
router.all("/", (req, res) => res.redirect("/qualiteer"));
|
|
|
|
if (process.env.USE_DEV_ROUTER === "true")
|
|
|
|
router.use("/api/dev", buildDevRoute(pg, skio));
|
|
|
|
|
|
|
|
// Middlewares
|
|
|
|
|
|
|
|
// Routes
|
2022-07-12 23:28:47 +00:00
|
|
|
router.use("/qualiteer", react); // Static Build Route
|
2022-07-12 21:26:36 +00:00
|
|
|
router.use("/api/results", results);
|
|
|
|
router.use("/api/alerting", alerting);
|
|
|
|
router.use("/api/catalog", catalog);
|
|
|
|
|
|
|
|
return router;
|
|
|
|
}
|