From: Chocobozzz Date: Tue, 1 Nov 2016 18:17:25 +0000 (+0100) Subject: Server: use constants to get port configuration X-Git-Tag: v0.0.1-alpha~651 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=d16b5172ae95f2389084ba2a301088358605771f;p=github%2FChocobozzz%2FPeerTube.git Server: use constants to get port configuration --- diff --git a/server.js b/server.js index 28ad4fc08..b29fba633 100644 --- a/server.js +++ b/server.js @@ -40,9 +40,6 @@ const mongoose = require('mongoose') const routes = require('./server/controllers') const Request = mongoose.model('Request') -// Get configurations -const port = config.get('listen.port') - // ----------- Command line ----------- // ----------- App ----------- @@ -129,6 +126,7 @@ app.use(function (err, req, res, next) { res.sendStatus(err.status || 500) }) +const port = constants.CONFIG.LISTEN.PORT installer.installApplication(function (err) { if (err) throw err diff --git a/server/initializers/constants.js b/server/initializers/constants.js index 0efbbb916..d345776ff 100644 --- a/server/initializers/constants.js +++ b/server/initializers/constants.js @@ -31,6 +31,9 @@ const OAUTH_LIFETIME = { // --------------------------------------------------------------------------- const CONFIG = { + LISTEN: { + PORT: config.get('listen.port') + }, DATABASE: { DBNAME: 'peertube' + config.get('database.suffix'), HOSTNAME: config.get('database.hostname'),