aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/index.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-15 22:22:03 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-20 09:57:40 +0200
commit65fcc3119c334b75dd13bcfdebf186afdc580a8f (patch)
tree4f2158c61a9b7c3f47cfa233d01413b946ee53c0 /server/controllers/api/index.ts
parentd5f345ed4cfac4e1fa84dcb4fce1cda4d32f9c73 (diff)
downloadPeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.gz
PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.zst
PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.zip
First typescript iteration
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}