index.js: add HOST environment argument

This commit is contained in:
xanoni 2021-08-23 18:06:44 -04:00 committed by Overtorment
parent e9c6f3abde
commit a01a8c6e14

View File

@ -47,7 +47,10 @@ app.use('/static', express.static('static'));
app.use(require('./controllers/api'));
app.use(require('./controllers/website'));
let server = app.listen(process.env.PORT || 3000, function () {
logger.log('BOOTING UP', 'Listening on port ' + (process.env.PORT || 3000));
const bindHost = process.env.HOST || '0.0.0.0';
const bindPort = process.env.PORT || 3000;
let server = app.listen(bindPort, bindHost, function () {
logger.log('BOOTING UP', 'Listening on ' + bindHost + ':' + bindPort);
});
module.exports = server;