module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:7788',//真实的路径
ws: true,
changeOrigin: true,
pathRewrite:{ //路径重写
'^/api':''
}
},
'/foo':{
target:'http://localhost:3001'
}
}
}
}
使用proxy解决跨域
最新推荐文章于 2024-06-13 23:47:14 发布