webpack代理---pathRewrite
今天遇到个问题,前提是项目是我本地有一份后端,端口号不同,前台4000,后端3100,请求方式4000代理到3100
代理到本地:
接口请求方式如下
http://localhost:4000/api/scoringrules/all //每个请求后面都有/api
配置:
"proxy": {
"/api": {
"target": "http://localhost:3100",
"changeOrigin": true,
"pathRewrite": {
原创
2020-09-21 15:24:08 ·
8291 阅读 ·
0 评论