blob: d2459d8dba1d1efdc34d729ac79ad8cbfdaa343d [file] [log] [blame]
const httpProxy = require('http-proxy');
const target = process.env.PROXY || '192.168.46.100';
const proxy = httpProxy.createProxyServer({
target: `http://${target}:9101`
});
const extensionsProxy = httpProxy.createProxyServer({
target: `http://${target}/spa/`
});
proxy.on('error', function(error, req, res) {
res.writeHead(500, {
'Content-Type': 'text/plain'
});
console.error('[Proxy]', error);
});
module.exports = {
proxy,
extensionsProxy
};