",
+ "homepage": "https://github.com/splitio/javascript-client",
+ "license": "Apache-2.0",
+ "repository": "https://github.com/splitio/javascript-client/tree/master/crazy-cdn",
+ "main": "lib/index.js",
+ "scripts": {
+ "start": "node lib/index.js",
+ "m": "nodemon lib/index.js",
+ "b": "babel src --out-dir lib",
+ "w": "babel src --out-dir lib -w"
+ },
+ "engines": {
+ "node": "4.4.3",
+ "npm": "3.9.3"
+ },
+ "dependencies": {
+ "express": "^4.14.0",
+ "http-proxy": "^1.14.0"
+ },
+ "devDependencies": {
+ "babel-cli": "^6.10.1",
+ "babel-preset-es2015-node4": "^2.1.0",
+ "nodemon": "^1.9.2"
+ }
+}
diff --git a/crazy-cdn/src/index.js b/crazy-cdn/src/index.js
new file mode 100644
index 000000000..d999eff0a
--- /dev/null
+++ b/crazy-cdn/src/index.js
@@ -0,0 +1,38 @@
+const express = require('express');
+const app = express();
+
+const httpProxy = require('http-proxy');
+const proxy = httpProxy.createProxyServer({});
+
+app.use(function(err, req, res, next) {
+ res.status(503).send(JSON.stringigy(err));
+});
+
+app.use(function delay(req, res, next) {
+ setTimeout(next, Math.random() * 3000);
+});
+
+app.use(function internalError(req, res, next) {
+ // if (Math.random() > 0.8) {
+ if (false) {
+ res.status(500).send({
+ status: 500,
+ message: 'internal error',
+ type:'internal'
+ });
+ } else {
+ next();
+ }
+});
+
+app.all('/*', function(req, res) {
+ proxy.web(req, res, {
+ target: 'https://sdk-aws-staging.split.io',
+ secure: false,
+ changeOrigin: true
+ });
+});
+
+app.listen(3000, function () {
+ console.log('Crazy proxy at 3000 port');
+});
diff --git a/demos/browser-split/offline/app.js b/demos/browser-split/offline/app.js
index e7648c459..99f22f4fb 100644
--- a/demos/browser-split/offline/app.js
+++ b/demos/browser-split/offline/app.js
@@ -31,7 +31,7 @@ console.info(
// The following code will be evaluated once the engine finalice the
// initialization
//
-sdk.ready().then(function () {
+sdk.on(sdk.Event.SDK_READY, function onSDKReady() {
//
// Some simple cases for my defined features
//
@@ -48,3 +48,6 @@ sdk.ready().then(function () {
"<= The expected answer based on the definition before is 'delta'"
);
});
+
+// just to show up the deprecated message
+sdk.ready().then(function() {});
diff --git a/demos/browser-split/offline/index.html b/demos/browser-split/offline/index.html
index fda2b5db3..e95a0a26d 100644
--- a/demos/browser-split/offline/index.html
+++ b/demos/browser-split/offline/index.html
@@ -10,7 +10,7 @@
Hello SPLIT! => Please use the devTools to start testing the engine!
-
+