Код: Выделить всё
import express from "express";
import { isAdmin } from "../middlewares/auth.middleware";
import notificationControllers from "../controllers/notification.controller";
const adminRouter = express.Router();
// Routes for individual notifications
adminRouter
.route("/notification/:notificationId")
.put(isAdmin, notificationControllers.updateNotificationController)
.delete(isAdmin, notificationControllers.deleteNotificationController)
.get(isAdmin, notificationControllers.getNotificationByIdController);
// Routes for notification groups
adminRouter
.route("/notification/group")
.post(isAdmin, notificationControllers.createNotificationGroupController)
.get(isAdmin, notificationControllers.getNotificationGroupsController);
export default adminRouter;
Подробнее здесь: https://stackoverflow.com/questions/793 ... ess-routes