Server: use constants to get port configuration
authorChocobozzz <florian.bigard@gmail.com>
Tue, 1 Nov 2016 18:17:25 +0000 (19:17 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Tue, 1 Nov 2016 18:17:25 +0000 (19:17 +0100)
server.js
server/initializers/constants.js

index 28ad4fc0893055d70610ced6d17ec93106bd1203..b29fba6334881ed483d9e7ce76db6dd8a304fc75 100644 (file)
--- 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
 
index 0efbbb9168c1ec57a1d5c00e9a5af2396802c039..d345776ff2afb53e74cd371cfce281ce637b5e2f 100644 (file)
@@ -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'),