PeerTube/server/controllers/api/v1/index.js

25 lines
638 B
JavaScript
Raw Normal View History

'use strict'
2015-06-09 10:41:40 -05:00
var express = require('express')
2016-01-31 04:23:52 -06:00
var router = express.Router()
2015-06-09 10:41:40 -05:00
2016-02-07 04:47:30 -06:00
var podsController = require('./pods')
var remoteVideosController = require('./remoteVideos')
var videosController = require('./videos')
router.use('/pods', podsController)
router.use('/remotevideos', remoteVideosController)
router.use('/videos', videosController)
2016-03-07 11:53:03 -06:00
router.use('/*', badRequest)
2016-01-31 04:23:52 -06:00
// ---------------------------------------------------------------------------
2015-11-07 11:22:05 -06:00
module.exports = router
2016-03-07 11:53:03 -06:00
// ---------------------------------------------------------------------------
function badRequest (req, res, next) {
2016-03-14 07:50:19 -05:00
res.type('json').status(400).end()
2016-03-07 11:53:03 -06:00
}