Comparing version 0.9.1 to 0.9.2
{ | ||
"name": "frodoio", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "Node.js library for distributing requests in a ring of servers", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -10,8 +10,18 @@ var Etcd = require('./promise.etcd'); | ||
this.ready = Q(); | ||
var servers = this.config.servers || [ | ||
var rawServers = this.config.etcdServers || [ | ||
{ host: '127.0.0.1', port: 4001 } | ||
]; | ||
if (!_.isArray(servers)) { | ||
servers = [ servers ]; | ||
if (!_.isArray(rawServers)) { | ||
rawServers = [ rawServers ]; | ||
} | ||
var servers = []; | ||
rawServers.forEach(function (server) { | ||
if (_.isString(server)) { | ||
servers.push({ host: server, port: 4001 }); | ||
} else if (_.isObject(server)) { | ||
servers.push({ host: server.host || '127.0.0.1', port: server.port || 4001 }); | ||
} else { | ||
throw new Error(server + ' as a server should be an address <string> or { host: <string>, port: <integer> }') | ||
} | ||
}); | ||
@@ -21,3 +31,3 @@ // TODO: Support more than one server | ||
if (!config.lazy) { | ||
if (!this.config.lazy) { | ||
this.ready = this.init(); | ||
@@ -24,0 +34,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10246
283