Browse Source

Allow configuring HTTP server bind address via BTCEXP_HOST

fix-133-memory-crash
Nadav Ivgi 6 years ago
parent
commit
614ed5b080
  1. 3
      bin/cli.js
  2. 5
      bin/www

3
bin/cli.js

@ -6,6 +6,7 @@ const args = require('meow')(`
Options
-p, --port <port> port to bind http server [default: 3002]
-i, --host <host> host to bind http server [default: 127.0.0.1]
-a, --basic-auth-password <..> protect web interface with a password [default: no password]
-C, --coin <coin> crypto-coin to enable [default: BTC]
@ -53,7 +54,7 @@ const args = require('meow')(`
$ BTCEXP_PORT=8080 BTCEXP_BITCOIND_PORT=18443 BTCEXP_BITCOIND_COOKIE=~/.bitcoin/regtest/.cookie btc-rpc-explorer
`, { flags: { port: {alias:'p'}, basicAuthPassword: {alias:'a'}, coin: {alias:'C'}
`, { flags: { port: {alias:'p'}, host: {alias:'i'}, basicAuthPassword: {alias:'a'}, coin: {alias:'C'}
, bitcoindUri: {alias:'b'}, bitcoindHost: {alias:'H'}, bitcoindPort: {alias:'P'}
, bitcoindCookie: {alias:'c'}, bitcoindUser: {alias:'u'}, bitcoindPass: {alias:'w'}
, demo: {type:'boolean'}, rpcAllowall: {type:'boolean'}, electrumxServers: {alias:'E'}

5
bin/www

@ -3,9 +3,10 @@ var debug = require('debug')('my-application');
var app = require('../app');
app.set('port', process.env.PORT || process.env.BTCEXP_PORT || 3002);
app.set('host', process.env.BTCEXP_HOST || '127.0.0.1');
var server = app.listen(app.get('port'), function() {
debug('Express server listening on port ' + server.address().port);
var server = app.listen(app.get('port'), app.get('host'), function() {
debug('Express server listening on ' + server.address().address + ':' + server.address().port);
if (app.runOnStartup) {
app.runOnStartup();

Loading…
Cancel
Save