X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server.js;h=d38c5830f3f0ac565fbfdbe4b5554c98dc7c2bad;hb=99a64bfed25e45547df3045cf249bc895e6f220b;hp=9322bca19e500038fced0335f8a644a09c786248;hpb=907e9510c28b4b2816cba0c070e3feaa16b10ac3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server.js b/server.js index 9322bca19..d38c5830f 100644 --- a/server.js +++ b/server.js @@ -13,14 +13,6 @@ const WebSocketServer = require('ws').Server // Create our main app const app = express() -// ----------- Checker ----------- -const checker = require('./server/initializers/checker') - -const miss = checker.checkConfig() -if (miss.length !== 0) { - throw new Error('Miss some configurations keys : ' + miss) -} - // ----------- Database ----------- const config = require('config') const constants = require('./server/initializers/constants') @@ -29,8 +21,16 @@ const logger = require('./server/helpers/logger') database.connect() +// ----------- Checker ----------- +const checker = require('./server/initializers/checker') + +const miss = checker.checkConfig() +if (miss.length !== 0) { + throw new Error('Miss some configurations keys : ' + miss) +} + // ----------- PeerTube modules ----------- -const customValidators = require('./server/helpers/customValidators') +const customValidators = require('./server/helpers/custom-validators') const installer = require('./server/initializers/installer') const mongoose = require('mongoose') const routes = require('./server/controllers') @@ -53,7 +53,7 @@ app.use(bodyParser.json()) app.use(bodyParser.urlencoded({ extended: false })) // Validate some params for the API app.use(expressValidator({ - customValidators: customValidators + customValidators: Object.assign({}, customValidators.misc, customValidators.users, customValidators.videos) })) // ----------- Views, routes and static files -----------