Files
Checkmate/server/routes/queueRoute.js
T
2025-07-21 10:34:16 -07:00

25 lines
925 B
JavaScript
Executable File

import { Router } from "express";
import { isAllowed } from "../middleware/isAllowed.js";
class QueueRoutes {
constructor(queueController) {
this.router = Router();
this.queueController = queueController;
this.initRoutes();
}
initRoutes() {
this.router.get("/jobs", isAllowed(["admin", "superadmin"]), this.queueController.getJobs);
this.router.post("/jobs", isAllowed(["admin", "superadmin"]), this.queueController.addJob);
this.router.get("/metrics", isAllowed(["admin", "superadmin"]), this.queueController.getMetrics);
this.router.get("/health", isAllowed(["admin", "superadmin"]), this.queueController.checkQueueHealth);
this.router.get("/all-metrics", isAllowed(["admin", "superadmin"]), this.queueController.getAllMetrics);
this.router.post("/flush", isAllowed(["admin", "superadmin"]), this.queueController.flushQueue);
}
getRouter() {
return this.router;
}
}
export default QueueRoutes;