Refactor API configuration method

This commit is contained in:
Andrew Stewart 2014-03-04 16:18:51 -08:00
parent 5120c35f7c
commit 9c5d1c3496
1 changed files with 5 additions and 3 deletions

View File

@ -91,10 +91,12 @@ var Cylon = (function() {
//
// Returns the API configuration
Master.prototype.api = function(opts) {
if (opts == null) { opts = {}; }
if (opts == null) { opts = {} };
this.api_config.host = opts.host || "127.0.0.1";
this.api_config.port = opts.port || "3000";
var host = opts.host || this.api_config.host,
port = opts.port || this.api_config.port;
this.api_config = { host: host, port: port };
return this.api_config;
};