2022-05-08 01:36:22 +00:00
|
|
|
import { Router, json as jsonMiddleware } from "express";
|
2022-08-06 21:21:41 +00:00
|
|
|
import { getTests, getPipelineMappings } from "../database/queries/catalog.js";
|
2022-05-08 01:36:22 +00:00
|
|
|
const router = Router();
|
|
|
|
|
|
|
|
const maxSize = 1024 * 1024 * 100; // 100MB
|
|
|
|
|
|
|
|
// Apply Middlewares
|
2022-05-17 12:32:04 +00:00
|
|
|
router.use(jsonMiddleware({ limit: maxSize }));
|
2022-05-08 01:36:22 +00:00
|
|
|
|
|
|
|
// Get Routes
|
2022-08-06 21:21:41 +00:00
|
|
|
router.get("/tests", (req, res) => {
|
|
|
|
getTests().then((t)=>res.json(t));
|
2022-05-08 01:36:22 +00:00
|
|
|
});
|
|
|
|
|
2022-08-06 21:21:41 +00:00
|
|
|
router.get("/pipeline-mappings", (req,res)=>{
|
|
|
|
getPipelineMappings().then((m)=>res.json(m));
|
|
|
|
})
|
|
|
|
|
2022-05-08 01:36:22 +00:00
|
|
|
// Post Routes
|
2022-05-17 12:32:04 +00:00
|
|
|
router.post("/update", (req, res) => {
|
2022-05-08 01:36:22 +00:00
|
|
|
// Update All Tests
|
|
|
|
res.sendStatus(200);
|
|
|
|
});
|
|
|
|
|
|
|
|
export default router;
|