1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00
pigallery2/backend/routes/NotificationRouter.ts

25 lines
743 B
TypeScript
Raw Normal View History

2018-03-30 15:30:30 -04:00
import {UserRoles} from '../../common/entities/UserDTO';
import {AuthenticationMWs} from '../middlewares/user/AuthenticationMWs';
import {RenderingMWs} from '../middlewares/RenderingMWs';
import {NotificationMWs} from '../middlewares/NotificationMWs';
2018-11-28 23:49:33 +01:00
import {Express} from 'express';
import {VersionMWs} from '../middlewares/VersionMWs';
2017-07-09 14:23:50 +02:00
export class NotificationRouter {
2018-11-28 23:49:33 +01:00
public static route(app: Express) {
2017-07-09 14:23:50 +02:00
this.addGetNotifications(app);
}
2018-11-28 23:49:33 +01:00
private static addGetNotifications(app: Express) {
2018-03-30 15:30:30 -04:00
app.get('/api/notifications',
2017-07-09 14:23:50 +02:00
AuthenticationMWs.authenticate,
AuthenticationMWs.authorise(UserRoles.Guest),
VersionMWs.injectGalleryVersion,
2017-07-09 14:23:50 +02:00
NotificationMWs.list,
RenderingMWs.renderResult
);
2018-03-30 15:30:30 -04:00
}
2017-07-09 14:23:50 +02:00
}