Find the vue.config.js file and change the address:
devServer: {
proxy: {
'/api': {
target: "http://localhost:Port number own address", //This replacement is the local address
changeOrigin: true,
logLevel: "debug"
}
}
}
Note:
vue.config.js Is an optional configuration file if the project’s (and package.json If this file exists in the root directory of the same level, it will be deleted @ vue/cli-service Automatic loading. You can also use package.json Medium vue Field, but note that this writing method requires you to strictly follow the JSON format.
Create in root directory: vue.config.js
Read More:
- Vue Project Error: Proxy error: Could not proxy request [How to Solve]
- [Solved] proxy Configure Error: Error occured while trying to proxy to:
- CRA 5.0.0 Add Proxy Project Start Error [How to Solve]
- Postman Error: Could not send request [How to Solve]
- Difference between contenttype and datatype in Ajax request of jquery
- Interface request error 504 gateway time out [How to Solve]
- Error:Request failed with status code 401 [How to Solve]
- [Solved] nodejs Error: request entity too large
- If the request parameter is formdata, use the Ajax operation
- Solve the asynchronous execution of callback function in Axios request processing interceptor
- JS getting ${pageContext.request.contextPath} Get the root path of the project
- [Solved] Font End Image Display Error: net::ERR_CONNECTION_RESET 431 (Request Header Fields Too Large)
- Trigger http request when tab page is closed in angular2+ project
- [Solved] node.js request Error: Error: unable to verify the first certificate
- [Solved] Console Error: Error: Request failed with status code 405
- request.js?b775:101 Uncaught (in promise) Error: Failed to convert value of type ‘java.lang.String’ to required type ‘java.lang.Long’;
- [Solved] “npm WARN logfile could not be created: Error: EPERM: operation not permitted,…”
- [Solved] Vue item packaging error: Failed to load resource: the server responded with a status of 404 (Not Found)
- ERROR Error: [@ant-design/icons-angular]:the icon XXX does not exist or is not registered.
- Vue Error: component has been registered but not used [Two Methods to Solve]