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