Use env PORT if defined
This commit is contained in:
@@ -33,6 +33,16 @@ module.exports = (confPaths) => {
|
||||
|
||||
appconfig = _.defaultsDeep(appconfig, appdata.defaults.config)
|
||||
|
||||
// Using ENV variables?
|
||||
|
||||
if (appconfig.port < 1) {
|
||||
appconfig.port = process.env.PORT || 80
|
||||
}
|
||||
|
||||
if (_.startsWith(appconfig.db, '$')) {
|
||||
appconfig.db = process.env[appconfig.db.slice(1)]
|
||||
}
|
||||
|
||||
// List authentication strategies
|
||||
|
||||
if (appdata.capabilities.manyAuthProviders) {
|
||||
|
@@ -54,12 +54,6 @@ module.exports = {
|
||||
self[modelName] = require(path.join(dbModelsPath, file))
|
||||
})
|
||||
|
||||
// Using ENV variable?
|
||||
|
||||
if (_.startsWith(appconfig.db, '$')) {
|
||||
appconfig.db = process.env[appconfig.db.slice(1)]
|
||||
}
|
||||
|
||||
// Connect
|
||||
|
||||
self.onReady = modb.connect(appconfig.db)
|
||||
|
Reference in New Issue
Block a user