Refactor API configuration method
This commit is contained in:
parent
5120c35f7c
commit
9c5d1c3496
|
@ -91,10 +91,12 @@ var Cylon = (function() {
|
||||||
//
|
//
|
||||||
// Returns the API configuration
|
// Returns the API configuration
|
||||||
Master.prototype.api = function(opts) {
|
Master.prototype.api = function(opts) {
|
||||||
if (opts == null) { opts = {}; }
|
if (opts == null) { opts = {} };
|
||||||
|
|
||||||
this.api_config.host = opts.host || "127.0.0.1";
|
var host = opts.host || this.api_config.host,
|
||||||
this.api_config.port = opts.port || "3000";
|
port = opts.port || this.api_config.port;
|
||||||
|
|
||||||
|
this.api_config = { host: host, port: port };
|
||||||
|
|
||||||
return this.api_config;
|
return this.api_config;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue