[CORD-1558] metro-net GUI development
Change-Id: Id85e7cec9d52717777c388f7bfde712bb72850e9
diff --git a/xos/gui/conf/proxy.js b/xos/gui/conf/proxy.js
new file mode 100644
index 0000000..02f9d5e
--- /dev/null
+++ b/xos/gui/conf/proxy.js
@@ -0,0 +1,18 @@
+const httpProxy = require('http-proxy');
+
+const target = process.env.PROXY || '192.168.46.100';
+
+const apiProxy = httpProxy.createProxyServer({
+ target: `http://${target}`
+});
+
+apiProxy.on('error', (error, req, res) => {
+ res.writeHead(500, {
+ 'Content-Type': 'text/plain'
+ });
+ console.error('[Proxy]', error);
+});
+
+module.exports = {
+ api: apiProxy
+};
\ No newline at end of file