publish event to all models involved
Change-Id: I869692fbababaa881ce2a0fc8f2ef6add5c7c243
diff --git a/conf/browsersync.conf.js b/conf/browsersync.conf.js
index dd7acd5..d820bb6 100644
--- a/conf/browsersync.conf.js
+++ b/conf/browsersync.conf.js
@@ -1,5 +1,6 @@
const conf = require('./gulp.conf');
-const proxy = require('./proxy');
+const proxy = require('./proxy').proxy;
+const extensionsProxy = require('./proxy').extensionsProxy;
module.exports = function () {
return {
@@ -12,6 +13,9 @@
if (req.url.indexOf('xosapi') !== -1) {
proxy.web(req, res);
}
+ // else if (req.url.indexOf('extensions') !== -1) {
+ // extensionsProxy.web(req, res);
+ // }
else{
next();
}
diff --git a/conf/proxy.js b/conf/proxy.js
index 6a7e8b0..fedbf72 100644
--- a/conf/proxy.js
+++ b/conf/proxy.js
@@ -4,6 +4,10 @@
target: 'http://192.168.46.100:9101'
});
+const extensionsProxy = httpProxy.createProxyServer({
+ target: 'http://192.168.46.100/spa/'
+});
+
proxy.on('error', function(error, req, res) {
res.writeHead(500, {
'Content-Type': 'text/plain'
@@ -11,4 +15,7 @@
console.error('[Proxy]', error);
});
-module.exports = proxy;
\ No newline at end of file
+module.exports = {
+ proxy,
+ extensionsProxy
+};
\ No newline at end of file