From 963b81864cd22402d52bb1092e59962c26f2cf60 Mon Sep 17 00:00:00 2001 From: azivner Date: Thu, 16 Nov 2017 23:06:16 -0500 Subject: [PATCH] startup now respects port in config file --- app.js | 1 - bin/www | 6 +++++- config-sample.ini | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 88d16ca36..ed046a23a 100644 --- a/app.js +++ b/app.js @@ -1,5 +1,4 @@ const log = require('./services/log'); -log.info("App starting up"); const express = require('express'); const path = require('path'); const favicon = require('serve-favicon'); diff --git a/bin/www b/bin/www index 1fd5041c7..86b602f4c 100755 --- a/bin/www +++ b/bin/www @@ -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. */ diff --git a/config-sample.ini b/config-sample.ini index 8826860ed..b48971cfc 100644 --- a/config-sample.ini +++ b/config-sample.ini @@ -1,2 +1,7 @@ +[Network] +port=80 + [Sync] -syncServerHost= \ No newline at end of file +syncServerHost= +syncServerTimeout=10000 +syncProxy= \ No newline at end of file