This commit is contained in:
afrokick 2019-04-01 17:17:38 +03:00
parent 5f3774fe44
commit 0be4f6066c
2 changed files with 11 additions and 2 deletions

View File

@ -26,6 +26,13 @@ module.exports = convict({
default: 'dev',
env: 'NODE_ENV'
},
host: {
doc: 'The host to bind.',
format: '*',
default: '0.0.0.0',
env: 'HOST',
arg: 'host'
},
port: {
doc: 'The port to bind.',
format: 'port',

View File

@ -17,7 +17,6 @@ process.on('uncaughtException', (e) => {
// parse config
let path = config.get('path');
const port = config.get('port');
if (path[0] !== '/') {
path = '/' + path;
@ -76,7 +75,10 @@ wss.on('error', error => {
logger.error(error);
});
server.listen(port, () => {
const port = config.get('port');
const host = config.get('host');
server.listen(port, host, () => {
const host = server.address().address;
const port = server.address().port;