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',
|
||||
help: 'Configuration file'
|
||||
})
|
||||
.option('bind', {
|
||||
abbr: 'b',
|
||||
default: undefined,
|
||||
help: 'Bind address'
|
||||
})
|
||||
.option('port', {
|
||||
abbr: 'p',
|
||||
default: 8080,
|
||||
|
@ -24,5 +29,6 @@ var opts = require('nomnom')
|
|||
|
||||
return require('./server')({
|
||||
config: opts.config,
|
||||
bind: opts.bind,
|
||||
port: opts.port
|
||||
});
|
||||
|
|
|
@ -293,7 +293,7 @@ module.exports = function(opts, callback) {
|
|||
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/',
|
||||
this.address().address, this.address().port);
|
||||
|
||||
|
|
Loading…
Reference in a new issue