as shown in the figure, using proxy to solve cross-domain, I see many blogs say that this can solve cross-domain. What is the reason for this?
A blog said that it was written in this way, and tried to report an error saying that proxy should not be an object, but should be in string format
"proxy": {
"/api": {
"target": "http://localhost:5000",
"pathRewrite": {
"^/api" : ""
},
"changeOrigin": true
}
}
react version is 16.5.2, and the backend interface uses node+mongodb, at port 5000
hoping for the help of bosses