Browse Source

Use defaults from config.js

activeAddress
Braydon Fuller 9 years ago
parent
commit
e476e86b7d
  1. 13
      bitcorenode/index.js
  2. 12
      test/bitcorenode.js

13
bitcorenode/index.js

@ -34,17 +34,16 @@ var Service = function(options) {
this.node = options.node;
this.https = options.https || this.node.https;
this.httpsOptions = options.httpsOptions || this.node.httpsOptions;
this.bwsPort = options.bwsPort || Service.BWS_PORT;
this.messageBrokerPort = options.messageBrokerPort || Service.MESSAGE_BROKER_PORT;
this.lockerPort = options.lockerPort || Service.LOCKER_PORT;
this.bwsPort = options.bwsPort || baseConfig.port;
this.messageBrokerPort = options.messageBrokerPort || 3380;
if (baseConfig.lockOpts) {
this.lockerPort = baseConfig.lockOpts.lockerServer.port;
}
this.lockerPort = options.lockerPort || this.lockerPort;
};
util.inherits(Service, EventEmitter);
Service.BWS_PORT = 3232;
Service.MESSAGE_BROKER_PORT = 3380;
Service.LOCKER_PORT = 3231;
Service.dependencies = ['insight-api'];
/**

12
test/bitcorenode.js

@ -26,9 +26,9 @@ describe('Bitcore Node Service', function() {
key: 'key',
cert: 'cert'
});
service.bwsPort.should.equal(Service.BWS_PORT);
service.messageBrokerPort.should.equal(Service.MESSAGE_BROKER_PORT);
service.lockerPort.should.equal(Service.LOCKER_PORT);
service.bwsPort.should.equal(3232);
service.messageBrokerPort.should.equal(3380);
service.lockerPort.should.equal(3231);
});
it('direct https options', function() {
var node = {};
@ -46,9 +46,9 @@ describe('Bitcore Node Service', function() {
key: 'key',
cert: 'cert'
});
service.bwsPort.should.equal(Service.BWS_PORT);
service.messageBrokerPort.should.equal(Service.MESSAGE_BROKER_PORT);
service.lockerPort.should.equal(Service.LOCKER_PORT);
service.bwsPort.should.equal(3232);
service.messageBrokerPort.should.equal(3380);
service.lockerPort.should.equal(3231);
});
it('can set custom ports', function() {
var node = {};

Loading…
Cancel
Save