request proxy plugin for egg framework. based on koa-proxy
$ npm i egg-proxy --save
// {app_root}/config/plugin.js
exports.proxy = {
enable: true,
package: 'egg-proxy',
};
Single:
// {app_root}/config/config.default.js
exports.proxy = {
host: 'http://localhost:9000', // target host that matched path will be proxy to
match: /\/assets/ // path pattern.
};
Multiple:
// {app_root}/config/config.default.js
exports.proxy = [{
host: 'host1',
match: /\/assets1/
}, {
host: 'host2',
match: /\/assets2/
}];
see config/config.default.js for more detail.
Please open an issue here.