I want to call the interface for aggregating data, but the configuration is wrong. Please help me find out what's going on.
What is the difference between '^/api': '/api' and '^/api': ''. I just learned it and don’t quite understand it.
The address of my request is: http://v.juhe.cn/movie/index?...
How can I correct my mistake?
proxyTable: {
'/xxx': {
}
}
xxx refers to the public part of the URL you send to the backend. You will use this character in almost every interface.
Then after matching, the localhost part of the address you want to send will be replaced with the target field (official URL),
As for RewritePath, it redirects the request for the resource to another path, making it different from the path indicated by the requested URL.
Whether you want to add it depends on the requirements
After reading your situation, I suggest you ask the backend if there is such a request interface, because you are reporting a 404 error and cannot find this interface, rather than a cross-domain problem
Only available in webpackDevServer environment