blob: 311dbcd3ca4f801d1dbecac847fbb0f1ffe6d93e [file] [log] [blame]
Matteo Scandolo2b16ea12017-07-13 11:50:59 -07001const httpProxy = require('http-proxy');
2
3const target = process.env.PROXY || '192.168.46.100';
4
5const apiProxy = httpProxy.createProxyServer({
6 target: `http://${target}`
7});
8
9apiProxy.on('error', (error, req, res) => {
10 res.writeHead(500, {
11 'Content-Type': 'text/plain'
12 });
13 console.error('[Proxy]', error);
14});
15
16module.exports = {
17 api: apiProxy
18};