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

23 lines
650 B
TypeScript
Raw Normal View History

2018-03-31 03:30:30 +08: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-29 06:49:33 +08:00
import {Express} from 'express';
2017-07-09 20:23:50 +08:00
export class NotificationRouter {
2018-11-29 06:49:33 +08:00
public static route(app: Express) {
2017-07-09 20:23:50 +08:00
this.addGetNotifications(app);
}
2018-11-29 06:49:33 +08:00
private static addGetNotifications(app: Express) {
2018-03-31 03:30:30 +08:00
app.get('/api/notifications',
2017-07-09 20:23:50 +08:00
AuthenticationMWs.authenticate,
AuthenticationMWs.authorise(UserRoles.Guest),
NotificationMWs.list,
RenderingMWs.renderResult
);
2018-03-31 03:30:30 +08:00
}
2017-07-09 20:23:50 +08:00
}