Server: use constants to get port configuration
This commit is contained in:
parent
b1233aa856
commit
d16b5172ae
|
@ -40,9 +40,6 @@ const mongoose = require('mongoose')
|
||||||
const routes = require('./server/controllers')
|
const routes = require('./server/controllers')
|
||||||
const Request = mongoose.model('Request')
|
const Request = mongoose.model('Request')
|
||||||
|
|
||||||
// Get configurations
|
|
||||||
const port = config.get('listen.port')
|
|
||||||
|
|
||||||
// ----------- Command line -----------
|
// ----------- Command line -----------
|
||||||
|
|
||||||
// ----------- App -----------
|
// ----------- App -----------
|
||||||
|
@ -129,6 +126,7 @@ app.use(function (err, req, res, next) {
|
||||||
res.sendStatus(err.status || 500)
|
res.sendStatus(err.status || 500)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const port = constants.CONFIG.LISTEN.PORT
|
||||||
installer.installApplication(function (err) {
|
installer.installApplication(function (err) {
|
||||||
if (err) throw err
|
if (err) throw err
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@ const OAUTH_LIFETIME = {
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
const CONFIG = {
|
const CONFIG = {
|
||||||
|
LISTEN: {
|
||||||
|
PORT: config.get('listen.port')
|
||||||
|
},
|
||||||
DATABASE: {
|
DATABASE: {
|
||||||
DBNAME: 'peertube' + config.get('database.suffix'),
|
DBNAME: 'peertube' + config.get('database.suffix'),
|
||||||
HOSTNAME: config.get('database.hostname'),
|
HOSTNAME: config.get('database.hostname'),
|
||||||
|
|
Loading…
Reference in New Issue