From 668acf1e1888c192fbdb2eb05f91957ab41938ae Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Fri, 14 Nov 2014 12:57:09 -0800 Subject: [PATCH] Add support for specifying API configuration to Cylon#api --- lib/cylon.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cylon.js b/lib/cylon.js index 33c9636..03b0105 100644 --- a/lib/cylon.js +++ b/lib/cylon.js @@ -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', {});