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