blob: fedbf729c8a9b1ce4c5641bcf8b8ce496ecf3fd6 [file] [log] [blame]
Matteo Scandoloc80ccbd2017-02-27 16:24:33 -08001const httpProxy = require('http-proxy');
2
3const proxy = httpProxy.createProxyServer({
Matteo Scandolo042ea632017-03-01 19:02:34 -08004 target: 'http://192.168.46.100:9101'
Matteo Scandoloc80ccbd2017-02-27 16:24:33 -08005});
6
Matteo Scandolo98b5f5d2017-03-17 17:09:05 -07007const extensionsProxy = httpProxy.createProxyServer({
8 target: 'http://192.168.46.100/spa/'
9});
10
Matteo Scandoloc80ccbd2017-02-27 16:24:33 -080011proxy.on('error', function(error, req, res) {
12 res.writeHead(500, {
13 'Content-Type': 'text/plain'
14 });
15 console.error('[Proxy]', error);
16});
17
Matteo Scandolo98b5f5d2017-03-17 17:09:05 -070018module.exports = {
19 proxy,
20 extensionsProxy
21};