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

25 lines
743 B
TypeScript

import {UserRoles} from '../../common/entities/UserDTO';
import {AuthenticationMWs} from '../middlewares/user/AuthenticationMWs';
import {RenderingMWs} from '../middlewares/RenderingMWs';
import {NotificationMWs} from '../middlewares/NotificationMWs';
import {Express} from 'express';
import {VersionMWs} from '../middlewares/VersionMWs';
export class NotificationRouter {
public static route(app: Express) {
this.addGetNotifications(app);
}
private static addGetNotifications(app: Express) {
app.get('/api/notifications',
AuthenticationMWs.authenticate,
AuthenticationMWs.authorise(UserRoles.Guest),
VersionMWs.injectGalleryVersion,
NotificationMWs.list,
RenderingMWs.renderResult
);
}
}