如图,使用proxy来解决跨域,看见很多博客说这个可以解决跨域,这是什么原因?有博客说用这种写法,试了一下报错说proxy不应该是一个对象,应该是字符串格式
"proxy": { "/api": { "target": "http://localhost:5000", "pathRewrite": { "^/api" : "" }, "changeOrigin": true } }
react版本为16.5.2,后端接口使用node+mongodb,为5000端口希望有大佬相助
白板的微信
相关分类