| const proxy = require('http-proxy-middleware'); |
| |
| const onosHost = 'localhost' |
| |
| module.exports = function(app) { |
| app.use(proxy('/onos', { |
| "target": `http://${onosHost}:8181/onos/v1`, |
| "pathRewrite": { |
| "^/onos": "", |
| }, |
| "secure": false, |
| "preserveHeaderKeyCase": true, |
| "headers": { |
| "Authorization": "Basic b25vczpyb2Nrcw==" |
| } |
| })) |
| |
| app.use(proxy('/dcs', { |
| "target": `http://${onosHost}:8181/onos/restconf`, |
| "pathRewrite": { |
| "^/dcs": "", |
| }, |
| "secure": false, |
| "preserveHeaderKeyCase": true, |
| "headers": { |
| "Authorization": "Basic b25vczpyb2Nrcw==" |
| } |
| })) |
| |
| } |