allowing the port to be defined by a custom port environment variable, for certain hosting environments

This commit is contained in:
Julian Lam
2016-08-23 15:10:46 -04:00
parent 34276dd638
commit dbdbfc6d75

2
app.js
View File

@@ -124,7 +124,7 @@ function start() {
nconf.set('secure', urlObject.protocol === 'https:');
nconf.set('use_port', !!urlObject.port);
nconf.set('relative_path', relativePath);
nconf.set('port', urlObject.port || nconf.get('port') || nconf.get('PORT') || 4567);
nconf.set('port', urlObject.port || nconf.get('port') || nconf.get('PORT') || (nconf.get('PORT_ENV_VAR') ? nconf.get(nconf.get('PORT_ENV_VAR')) : false) || 4567);
nconf.set('upload_url', nconf.get('upload_path').replace(/^\/public/, ''));
if (nconf.get('isPrimary') === 'true') {