Skip to content

Commit

Permalink
Specify HOST for express server to listen on #168 (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerOetzi authored and digitaldan committed Apr 21, 2018
1 parent ee8a09c commit 8e95065
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ if (app.get('env') === 'development') {

// App configuration for all environments
app.set('port', process.env.PORT || 3000);
app.set('host', process.env.HOST || '0.0.0.0');
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(favicon(__dirname + '/public/img/favicon.ico'));
Expand Down Expand Up @@ -340,8 +341,11 @@ app.use(function (req, res, next) {
});
app.use(serveStatic(path.join(__dirname, 'public')));

var server = app.listen(app.get('port'), function () {
logger.info('openHAB-cloud: express server listening on port ' + app.get('port'));
var server = app.listen({
host:app.get('host'),
port:app.get('port')
}, function () {
logger.info('openHAB-cloud: express server listening on ' +app.get('host') + ':' + app.get('port'));
});

var io = require('socket.io').listen(server, {
Expand Down

0 comments on commit 8e95065

Please sign in to comment.