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:
- [Solved] Install The Latest Version of Jest Error: TypeError: Cannot read property ‘instrument‘ of undefined
- [Solved] Syntax Error: Error: Cannot find module ‘cache-loader‘
- Vue2.0: How to Use vue3 api to encapsulate Axios
- [Solved] VS Code Error: Vetur can‘t find ‘tsconfig.json‘ or ‘jsconfig.json‘
- [Solved] Vue Compile Error: JavaScript heap out of memory
- [Solved] ERROR Error: Cannot find module ‘vue-loader-v16/package.json‘
- How to Solve VUE Error: Mixed spaces and tabs
- [Solved] Error: postcss plugin autoprefixer requires postcss 8 error report problem repair
- [Solved] Yapi Secondary deploy error: xxx validation failed: mock: Path `xxx` is required
- npm ERR code ELIFECYCLE [How to Solve]
- [Solved] Vue item packaging error: Failed to load resource: the server responded with a status of 404 (Not Found)
- Vue Error: component has been registered but not used [Two Methods to Solve]
- [Solved] Syntax Error: Error: No ESLint configuration found & TypeError: eslint.CLIEngine is not a constructor
- @requestbody: How to Use or Not Use
- React: How to Solve Web3 import error
- 9:13 error Component name “home“ should always be multi-word vue/multi-word-component-names
- After Vite starts, it will prompt “network: use ` — host ` to expose”, and the service cannot be accessed through network IP
- CRA 5.0.0 Add Proxy Project Start Error [How to Solve]
- [Solved] Syntax Error: Error: Loading PostCSS Plugin failed: Cannot find module ‘autoprefixer‘
- How to Solve JS error: Unexpected end of JSON input,Unexpected token u in JSON at position 0