aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/index.ts')
-rw-r--r--server/controllers/api/index.ts33
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 @@
1import express = require('express')
2
3import { badRequest } from '../../helpers'
4
5import { clientsRouter } from './clients'
6import { configRouter } from './config'
7import { podsRouter } from './pods'
8import { remoteRouter } from './remote'
9import { requestsRouter } from './requests'
10import { usersRouter } from './users'
11import { videosRouter } from './videos'
12
13const apiRouter = express.Router()
14
15apiRouter.use('/clients', clientsRouter)
16apiRouter.use('/config', configRouter)
17apiRouter.use('/pods', podsRouter)
18apiRouter.use('/remote', remoteRouter)
19apiRouter.use('/requests', requestsRouter)
20apiRouter.use('/users', usersRouter)
21apiRouter.use('/videos', videosRouter)
22apiRouter.use('/ping', pong)
23apiRouter.use('/*', badRequest)
24
25// ---------------------------------------------------------------------------
26
27export { apiRouter }
28
29// ---------------------------------------------------------------------------
30
31function pong (req, res, next) {
32 return res.send('pong').status(200).end()
33}