]>
Commit | Line | Data |
---|---|---|
5d79474c C |
1 | import * as express from 'express' |
2 | import { UserRight } from '../../../../shared/models/users' | |
a1587156 | 3 | import { authenticate, ensureUserHasRight } from '../../../middlewares' |
5d79474c C |
4 | |
5 | const debugRouter = express.Router() | |
6 | ||
7 | debugRouter.get('/debug', | |
8 | authenticate, | |
9 | ensureUserHasRight(UserRight.MANAGE_DEBUG), | |
a1587156 | 10 | getDebug |
5d79474c C |
11 | ) |
12 | ||
13 | // --------------------------------------------------------------------------- | |
14 | ||
15 | export { | |
16 | debugRouter | |
17 | } | |
18 | ||
19 | // --------------------------------------------------------------------------- | |
20 | ||
a1587156 | 21 | function getDebug (req: express.Request, res: express.Response) { |
5d79474c C |
22 | return res.json({ |
23 | ip: req.ip | |
24 | }).end() | |
25 | } |