This repository was archived by the owner on Apr 24, 2019. It is now read-only.
This repository was archived by the owner on Apr 24, 2019. It is now read-only.
Open
Description
因为我的项目需要调用多个 api, 请问如何配置多个 代理,
development: (config) => ({
compiler_public_path: `http://${config.server_host}:${config.server_port}/`,
proxy: {
enabled: true,
options: {
host: 'http://192.168.8.14:1338',
match: /^\/api\/.*/,
},
option2: {
host: 'http://apiv2.muzhifm.com',
match: /^\/muzhifmApi\/.*/,
map: (path) => {
console.log(path.replace('muzhifmApi', ''));
return path.replace('/muzhifmApi', '');
},
},
},
}),
我的代码是这样的,可是第二个不能成功.
if (config.proxy && config.proxy.enabled) {
app.use(convert(proxy(config.proxy.options)));
app.use(convert(proxy(config.proxy.option2)));
}
Metadata
Metadata
Assignees
Labels
No labels