Require on the top of the files

This commit is contained in:
Chocobozzz 2016-02-07 11:47:30 +01:00
parent 9f10b2928d
commit a030a9b234
5 changed files with 161 additions and 148 deletions

View File

@ -4,9 +4,13 @@ var express = require('express')
var router = express.Router()
router.use('/pods', require('./pods'))
router.use('/remotevideos', require('./remoteVideos'))
router.use('/videos', require('./videos'))
var podsController = require('./pods')
var remoteVideosController = require('./remoteVideos')
var videosController = require('./videos')
router.use('/pods', podsController)
router.use('/remotevideos', remoteVideosController)
router.use('/videos', videosController)
// ---------------------------------------------------------------------------

View File

@ -2,7 +2,10 @@
var constants = require('../initializers/constants')
var apiController = require('./api/' + constants.API_VERSION)
var viewsController = require('./views')
module.exports = {
api: require('./api/' + constants.API_VERSION),
views: require('./views')
api: apiController,
views: viewsController
}

View File

@ -1,9 +1,13 @@
'use strict'
var cacheMiddleware = require('./cache')
var reqValidatorsMiddleware = require('./reqValidators')
var secureMiddleware = require('./secure')
var middlewares = {
cache: require('./cache'),
reqValidators: require('./reqValidators'),
secure: require('./secure')
cache: cacheMiddleware,
reqValidators: reqValidatorsMiddleware,
secure: secureMiddleware
}
// ---------------------------------------------------------------------------

View File

@ -1,9 +1,13 @@
'use strict'
var podsReqValidators = require('./pods')
var remoteReqValidators = require('./remote')
var videosReqValidators = require('./videos')
var reqValidators = {
videos: require('./videos'),
pods: require('./pods'),
remote: require('./remote')
pods: podsReqValidators,
remote: remoteReqValidators,
videos: videosReqValidators
}
// ---------------------------------------------------------------------------

View File

@ -1,4 +1,3 @@
;(function () {
'use strict'
// ----------- Node modules -----------
@ -168,4 +167,3 @@
})
module.exports = app
})()