vuecli3 配置多个代理
强烈推介IDEA2020.2破解激活,IntelliJ IDEA 注册码,2020.2 IDEA 激活码
module.exports = {
devServer: {
proxy: {
'/api1': {
target: 'api1_url',
ws: true,
/* 允许跨域 */
changeOrigin: true,
pathRewrite: {
'^/api1': ''
}
},
'/api2': {
target: 'api2_url',
ws: true,
/* 允许跨域 */
changeOrigin: true,
pathRewrite: {
'^/api2': ''
}
}
}
}
}