Add support for specifying API configuration to Cylon#api

This commit is contained in:
Andrew Stewart 2014-11-14 12:57:09 -08:00
parent 25119c170f
commit 668acf1e18
1 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,11 @@ Cylon.robot = function robot(opts) {
// Public: Creates a new API based on passed options
//
// Returns nothing
Cylon.api = function api() {
Cylon.api = function api(opts) {
if (typeof opts === 'object') {
this.config({ api: opts });
}
var API = require('./api');
var config = Utils.fetch(Config, 'api', {});