You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
566 B

const proxy = require('koa-proxy');
const convert = require('koa-convert');
module.exports = {
entry(app, router, opts) {
app.use(convert(proxy({
host: opts.host,
match: opts.match,
map(path) {
return path.replace(opts.match, '');
},
})));
// Object.keys(opts).forEach((option) => {
// app.use(convert(proxy({
// host: opts[option].host,
// match: opts[option].match,
// map(path) {
// return path.replace(opts[option].match, '');
// },
// })));
// });
},
};