mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-02-05 00:28:30 -06:00
39 lines
958 B
JavaScript
39 lines
958 B
JavaScript
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("/:url", this.statusPageController.getStatusPageByUrl);
|
|
this.router.get("/team/:teamId", this.statusPageController.getStatusPagesByTeamId);
|
|
|
|
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;
|