Add route for getAllMonitorsWithUptimeStats
This commit is contained in:
1 parent
33e88642b3
commit
21de95b89a
1 file changed
+21
-23
@@ -1,18 +1,19 @@
|
|||||||
import { Router } from "express";
|
import { Router } from "express";
|
||||||
import {
|
import {
|
||||||
getAllMonitors,
|
getAllMonitors,
|
||||||
getMonitorStatsById,
|
getAllMonitorsWithUptimeStats,
|
||||||
getMonitorCertificate,
|
getMonitorStatsById,
|
||||||
getMonitorById,
|
getMonitorCertificate,
|
||||||
getMonitorsAndSummaryByTeamId,
|
getMonitorById,
|
||||||
getMonitorsByTeamId,
|
getMonitorsAndSummaryByTeamId,
|
||||||
createMonitor,
|
getMonitorsByTeamId,
|
||||||
checkEndpointResolution,
|
createMonitor,
|
||||||
deleteMonitor,
|
checkEndpointResolution,
|
||||||
deleteAllMonitors,
|
deleteMonitor,
|
||||||
editMonitor,
|
deleteAllMonitors,
|
||||||
pauseMonitor,
|
editMonitor,
|
||||||
addDemoMonitors,
|
pauseMonitor,
|
||||||
|
addDemoMonitors,
|
||||||
} from "../controllers/monitorController.js";
|
} from "../controllers/monitorController.js";
|
||||||
import { isAllowed } from "../middleware/isAllowed.js";
|
import { isAllowed } from "../middleware/isAllowed.js";
|
||||||
import { fetchMonitorCertificate } from "../controllers/controllerUtils.js";
|
import { fetchMonitorCertificate } from "../controllers/controllerUtils.js";
|
||||||
@@ -20,26 +21,23 @@ import { fetchMonitorCertificate } from "../controllers/controllerUtils.js";
|
|||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.get("/", getAllMonitors);
|
router.get("/", getAllMonitors);
|
||||||
|
router.get("/uptime", getAllMonitorsWithUptimeStats);
|
||||||
router.get("/stats/:monitorId", getMonitorStatsById);
|
router.get("/stats/:monitorId", getMonitorStatsById);
|
||||||
router.get("/certificate/:monitorId", (req, res, next) => {
|
router.get("/certificate/:monitorId", (req, res, next) => {
|
||||||
getMonitorCertificate(req, res, next, fetchMonitorCertificate);
|
getMonitorCertificate(req, res, next, fetchMonitorCertificate);
|
||||||
});
|
});
|
||||||
router.get("/:monitorId", getMonitorById);
|
router.get("/:monitorId", getMonitorById);
|
||||||
router.get("/team/summary/:teamId", getMonitorsAndSummaryByTeamId);
|
router.get("/team/summary/:teamId", getMonitorsAndSummaryByTeamId);
|
||||||
router.get("/team/:teamId", getMonitorsByTeamId);
|
router.get("/team/:teamId", getMonitorsByTeamId);
|
||||||
|
|
||||||
router.get(
|
router.get(
|
||||||
"/resolution/url",
|
"/resolution/url",
|
||||||
isAllowed(["admin", "superadmin"]),
|
isAllowed(["admin", "superadmin"]),
|
||||||
checkEndpointResolution
|
checkEndpointResolution
|
||||||
)
|
|
||||||
|
|
||||||
router.delete(
|
|
||||||
"/:monitorId",
|
|
||||||
isAllowed(["admin", "superadmin"]),
|
|
||||||
deleteMonitor
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
router.delete("/:monitorId", isAllowed(["admin", "superadmin"]), deleteMonitor);
|
||||||
|
|
||||||
router.post("/", isAllowed(["admin", "superadmin"]), createMonitor);
|
router.post("/", isAllowed(["admin", "superadmin"]), createMonitor);
|
||||||
|
|
||||||
router.put("/:monitorId", isAllowed(["admin", "superadmin"]), editMonitor);
|
router.put("/:monitorId", isAllowed(["admin", "superadmin"]), editMonitor);
|
||||||
|
|||||||
Reference in new issue
Block a user