Merge pull request #36 from efi-the-forking-continues/master
new feature: command line option for bind address
This commit is contained in:
commit
afda5d00bc
2 changed files with 7 additions and 1 deletions
|
@ -8,6 +8,11 @@ var opts = require('nomnom')
|
||||||
default: 'config.json',
|
default: 'config.json',
|
||||||
help: 'Configuration file'
|
help: 'Configuration file'
|
||||||
})
|
})
|
||||||
|
.option('bind', {
|
||||||
|
abbr: 'b',
|
||||||
|
default: undefined,
|
||||||
|
help: 'Bind address'
|
||||||
|
})
|
||||||
.option('port', {
|
.option('port', {
|
||||||
abbr: 'p',
|
abbr: 'p',
|
||||||
default: 8080,
|
default: 8080,
|
||||||
|
@ -24,5 +29,6 @@ var opts = require('nomnom')
|
||||||
|
|
||||||
return require('./server')({
|
return require('./server')({
|
||||||
config: opts.config,
|
config: opts.config,
|
||||||
|
bind: opts.bind,
|
||||||
port: opts.port
|
port: opts.port
|
||||||
});
|
});
|
||||||
|
|
|
@ -293,7 +293,7 @@ module.exports = function(opts, callback) {
|
||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
|
|
||||||
var server = app.listen(process.env.PORT || opts.port, function() {
|
var server = app.listen(process.env.PORT || opts.port, process.env.BIND || opts.bind, function() {
|
||||||
console.log('Listening at http://%s:%d/',
|
console.log('Listening at http://%s:%d/',
|
||||||
this.address().address, this.address().port);
|
this.address().address, this.address().port);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue