startup now respects port in config file

This commit is contained in:
azivner
2017-11-16 23:06:16 -05:00
parent 92027af426
commit 963b81864c
3 changed files with 11 additions and 3 deletions
+5 -1
View File
@@ -11,11 +11,13 @@ process.on('unhandledRejection', error => {
const app = require('../app');
const debug = require('debug')('node:server');
const http = require('http');
const config = require('../services/config');
const log = require('../services/log');
/**
* Get port from environment and store in Express.
*/
const port = normalizePort(process.env.PORT || '3000');
const port = normalizePort(config['Network']['port'] || '3000');
app.set('port', port);
/**
@@ -23,6 +25,8 @@ app.set('port', port);
*/
const server = http.createServer(app);
log.info("App server starting up at port " + port);
/**
* Listen on provided port, on all network interfaces.
*/