diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-15 22:22:03 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-20 09:57:40 +0200 |
commit | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (patch) | |
tree | 4f2158c61a9b7c3f47cfa233d01413b946ee53c0 /server/controllers/api/index.ts | |
parent | d5f345ed4cfac4e1fa84dcb4fce1cda4d32f9c73 (diff) | |
download | PeerTube-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.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 | } | ||