blob: 4233cfde1bff8652693b2241d9fbe6341d39676c [file] [log] [blame]
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=="
}
}))
}