diff options
Diffstat (limited to 'server/controllers/api/index.ts')
-rw-r--r-- | server/controllers/api/index.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts new file mode 100644 index 000000000..18bef2d3d --- /dev/null +++ b/server/controllers/api/index.ts | |||
@@ -0,0 +1,33 @@ | |||
1 | import express = require('express') | ||
2 | |||
3 | import { badRequest } from '../../helpers' | ||
4 | |||
5 | import { clientsRouter } from './clients' | ||
6 | import { configRouter } from './config' | ||
7 | import { podsRouter } from './pods' | ||
8 | import { remoteRouter } from './remote' | ||
9 | import { requestsRouter } from './requests' | ||
10 | import { usersRouter } from './users' | ||
11 | import { videosRouter } from './videos' | ||
12 | |||
13 | const apiRouter = express.Router() | ||
14 | |||
15 | apiRouter.use('/clients', clientsRouter) | ||
16 | apiRouter.use('/config', configRouter) | ||
17 | apiRouter.use('/pods', podsRouter) | ||
18 | apiRouter.use('/remote', remoteRouter) | ||
19 | apiRouter.use('/requests', requestsRouter) | ||
20 | apiRouter.use('/users', usersRouter) | ||
21 | apiRouter.use('/videos', videosRouter) | ||
22 | apiRouter.use('/ping', pong) | ||
23 | apiRouter.use('/*', badRequest) | ||
24 | |||
25 | // --------------------------------------------------------------------------- | ||
26 | |||
27 | export { apiRouter } | ||
28 | |||
29 | // --------------------------------------------------------------------------- | ||
30 | |||
31 | function pong (req, res, next) { | ||
32 | return res.send('pong').status(200).end() | ||
33 | } | ||