mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-01 06:00:24 -05:00
47 lines
1.1 KiB
JavaScript
Executable File
47 lines
1.1 KiB
JavaScript
Executable File
import { Router } from "express";
|
|
import { verifyJWT } from "../middleware/verifyJWT.js";
|
|
import multer from "multer";
|
|
const upload = multer();
|
|
|
|
class StatusPageRoutes {
|
|
constructor(statusPageController) {
|
|
this.router = Router();
|
|
this.statusPageController = statusPageController;
|
|
this.initRoutes();
|
|
}
|
|
|
|
initRoutes() {
|
|
this.router.get("/", this.statusPageController.getStatusPage);
|
|
this.router.get(
|
|
"/team/:teamId",
|
|
verifyJWT,
|
|
this.statusPageController.getStatusPagesByTeamId
|
|
);
|
|
this.router.get("/:url", this.statusPageController.getStatusPageByUrl);
|
|
this.router.get(
|
|
"/distributed/:url",
|
|
this.statusPageController.getDistributedStatusPageByUrl
|
|
);
|
|
|
|
this.router.post(
|
|
"/",
|
|
upload.single("logo"),
|
|
verifyJWT,
|
|
this.statusPageController.createStatusPage
|
|
);
|
|
this.router.put(
|
|
"/",
|
|
upload.single("logo"),
|
|
verifyJWT,
|
|
this.statusPageController.updateStatusPage
|
|
);
|
|
this.router.delete("/:url(*)", verifyJWT, this.statusPageController.deleteStatusPage);
|
|
}
|
|
|
|
getRouter() {
|
|
return this.router;
|
|
}
|
|
}
|
|
|
|
export default StatusPageRoutes;
|