module.exports = {
//本地服务器默认域名是http://localhost:8000
devServer: {
//代理
proxy: {
'/api': {
target: 'http://localhost:3000',
pathRewrite: {'^/api' : ''},
changeOrigin: true, // target是域名的话,需要这个参数,
secure: false, // 设置支持https协议的代理
},
}
}
};
webpack 解决 跨域问题
猜你喜欢
转载自blog.csdn.net/weixin_46337813/article/details/104631461
今日推荐
周排行