From bd475ae6ae43cbe1d937ab7c4326ac0dda9bc81f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 29 Oct 2015 01:09:10 -0400 Subject: make proxy work for gets --- StoneIsland/www/js/sdk/_sdk.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'StoneIsland/www/js/sdk/_sdk.js') diff --git a/StoneIsland/www/js/sdk/_sdk.js b/StoneIsland/www/js/sdk/_sdk.js index a7ecf6d3..dedcd5f0 100644 --- a/StoneIsland/www/js/sdk/_sdk.js +++ b/StoneIsland/www/js/sdk/_sdk.js @@ -4,8 +4,17 @@ var sdk = (function(){ var endpoint = "https://sandbox.api.yoox.biz/" sdk.init = function(opt){ - if (opt && opt.production) { - endpoint = "https://secure.api.yoox.biz/" + switch (opt.env || "development") { + case "production": + endpoint = "https://secure.api.yoox.biz/" + break + case "test": + endpoint = "http://lvh.me:4567/" + break + case "development": + default: + endpoint = "https://sandbox.api.yoox.biz/" + break } } @@ -23,4 +32,4 @@ var sdk = (function(){ }) return sdk -})() \ No newline at end of file +})() -- cgit v1.2.3-70-g09d2