This commit is contained in:
parent
5f3774fe44
commit
0be4f6066c
@ -26,6 +26,13 @@ module.exports = convict({
|
|||||||
default: 'dev',
|
default: 'dev',
|
||||||
env: 'NODE_ENV'
|
env: 'NODE_ENV'
|
||||||
},
|
},
|
||||||
|
host: {
|
||||||
|
doc: 'The host to bind.',
|
||||||
|
format: '*',
|
||||||
|
default: '0.0.0.0',
|
||||||
|
env: 'HOST',
|
||||||
|
arg: 'host'
|
||||||
|
},
|
||||||
port: {
|
port: {
|
||||||
doc: 'The port to bind.',
|
doc: 'The port to bind.',
|
||||||
format: 'port',
|
format: 'port',
|
||||||
|
@ -17,7 +17,6 @@ process.on('uncaughtException', (e) => {
|
|||||||
|
|
||||||
// parse config
|
// parse config
|
||||||
let path = config.get('path');
|
let path = config.get('path');
|
||||||
const port = config.get('port');
|
|
||||||
|
|
||||||
if (path[0] !== '/') {
|
if (path[0] !== '/') {
|
||||||
path = '/' + path;
|
path = '/' + path;
|
||||||
@ -76,7 +75,10 @@ wss.on('error', error => {
|
|||||||
logger.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 host = server.address().address;
|
||||||
const port = server.address().port;
|
const port = server.address().port;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user