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/index.js | 2 +- StoneIsland/www/js/sdk/_sdk.js | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'StoneIsland') diff --git a/StoneIsland/www/js/index.js b/StoneIsland/www/js/index.js index 332e780d..a8c36ef1 100644 --- a/StoneIsland/www/js/index.js +++ b/StoneIsland/www/js/index.js @@ -5,7 +5,7 @@ var app = (function(){ app.bind() app.build() - sdk.init({ production: true }) + sdk.init({ env: 'production' }) if (window.cordova) { document.addEventListener('deviceready', app.ready, false) 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