routes -> ts

This commit is contained in:
Alex Holliday committed 2026-01-21 10:36:03 -08:00
1 parent 35488fed3e
commit 81c7c992e2
13 files changed
+74 -42

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
import { RequestHandler, Router } from "express";
import multer from "multer";
const upload = multer();
class StatusPageRoutes {
private router: Router;
private statusPageController: any;
constructor(statusPageController: any, verifyJWT: RequestHandler) {
this.router = Router();
this.statusPageController = statusPageController;
this.initRoutes(verifyJWT);
}
initRoutes(verifyJWT: RequestHandler) {
this.router.get("/", this.statusPageController.getStatusPage);
this.router.get("/team", verifyJWT, 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.get("/:url", this.statusPageController.getStatusPageByUrl);
this.router.delete("/:url(*)", verifyJWT, this.statusPageController.deleteStatusPage);
}
getRouter() {
return this.router;
}
}
export default StatusPageRoutes;