1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/backend/routes/NotificationRouter.ts

25 lines
676 B
TypeScript
Raw Normal View History

2017-07-09 20:23:50 +08:00
import {UserRoles} from "../../common/entities/UserDTO";
import {AuthenticationMWs} from "../middlewares/user/AuthenticationMWs";
import {RenderingMWs} from "../middlewares/RenderingMWs";
import {NotificationMWs} from "../middlewares/NotificationMWs";
import Request = Express.Request;
import Response = Express.Response;
export class NotificationRouter {
public static route(app: any) {
this.addGetNotifications(app);
}
private static addGetNotifications(app) {
app.get("/api/notifications",
AuthenticationMWs.authenticate,
AuthenticationMWs.authorise(UserRoles.Guest),
NotificationMWs.list,
RenderingMWs.renderResult
);
};
}