diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-12-30 12:53:41 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-12-30 12:53:41 +0100 |
commit | a6fd2b30bf717eec14972a2175354781f5f43e77 (patch) | |
tree | 0a4fcd68e5630cf4a3274d087b4be54beac64bfa /server/controllers/api/index.js | |
parent | 8fd66b75bfbd8fd4945f1944411461b05eb74795 (diff) | |
download | PeerTube-a6fd2b30bf717eec14972a2175354781f5f43e77.tar.gz PeerTube-a6fd2b30bf717eec14972a2175354781f5f43e77.tar.zst PeerTube-a6fd2b30bf717eec14972a2175354781f5f43e77.zip |
Server: move remote routes in their own directory
Diffstat (limited to 'server/controllers/api/index.js')
-rw-r--r-- | server/controllers/api/index.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/server/controllers/api/index.js b/server/controllers/api/index.js index 4cb65ed55..f13ff922c 100644 --- a/server/controllers/api/index.js +++ b/server/controllers/api/index.js | |||
@@ -2,6 +2,8 @@ | |||
2 | 2 | ||
3 | const express = require('express') | 3 | const express = require('express') |
4 | 4 | ||
5 | const utils = require('../../helpers/utils') | ||
6 | |||
5 | const router = express.Router() | 7 | const router = express.Router() |
6 | 8 | ||
7 | const clientsController = require('./clients') | 9 | const clientsController = require('./clients') |
@@ -18,7 +20,7 @@ router.use('/requests', requestsController) | |||
18 | router.use('/users', usersController) | 20 | router.use('/users', usersController) |
19 | router.use('/videos', videosController) | 21 | router.use('/videos', videosController) |
20 | router.use('/ping', pong) | 22 | router.use('/ping', pong) |
21 | router.use('/*', badRequest) | 23 | router.use('/*', utils.badRequest) |
22 | 24 | ||
23 | // --------------------------------------------------------------------------- | 25 | // --------------------------------------------------------------------------- |
24 | 26 | ||
@@ -29,7 +31,3 @@ module.exports = router | |||
29 | function pong (req, res, next) { | 31 | function pong (req, res, next) { |
30 | return res.send('pong').status(200).end() | 32 | return res.send('pong').status(200).end() |
31 | } | 33 | } |
32 | |||
33 | function badRequest (req, res, next) { | ||
34 | res.type('json').status(400).end() | ||
35 | } | ||