big update - fully functional

This commit is contained in:
Daniel Ledda
2021-03-21 16:19:52 +01:00
parent 50362860ae
commit 5466b8d2bb
25 changed files with 824 additions and 461 deletions

View File

@@ -2,15 +2,18 @@ import express from "express";
import {ClayPIError, GenericPersistenceError} from "./errors";
import newSnapshotRouter from "./snapshotRouter";
import {CollectionRegistry} from "./Collections";
import newByteSeriesRouter from "./byteSeriesRouter";
export function newMainRouter(collections: CollectionRegistry) {
const router = express.Router();
const snapshotRouter = newSnapshotRouter(collections);
const byteSeriesRouter = newByteSeriesRouter(collections);
router.get("/dashboard", (req, res) => {
res.render("index.ejs", { rootUrl: req.app.locals.rootUrl });
});
router.use("/api/snapshots", snapshotRouter);
router.use("/api/timeseries", byteSeriesRouter);
router.use(topLevelErrorHandler);
return router;