[CORD-1044] Migrating vTR Dashboard to the new GUI using gui-extensions
Change-Id: I33847766b790ffba2b9a9e9cfab9a7060734ce91
diff --git a/xos/gui/conf/proxy.js b/xos/gui/conf/proxy.js
new file mode 100644
index 0000000..c410f04
--- /dev/null
+++ b/xos/gui/conf/proxy.js
@@ -0,0 +1,28 @@
+const httpProxy = require('http-proxy');
+
+const apiProxy = httpProxy.createProxyServer({
+ target: 'http://192.168.46.100:9101'
+});
+
+const staticFilesProxy = httpProxy.createProxyServer({
+ target: 'http://192.168.46.100/spa'
+});
+
+apiProxy.on('error', (error, req, res) => {
+ res.writeHead(500, {
+ 'Content-Type': 'text/plain'
+ });
+ console.error('[Proxy]', error);
+});
+
+staticFilesProxy.on('error', (error, req, res) => {
+ res.writeHead(500, {
+ 'Content-Type': 'text/plain'
+ });
+ console.error('[Proxy]', error);
+});
+
+module.exports = {
+ api: apiProxy,
+ static: staticFilesProxy
+};