Vue front and back end ports are inconsistentIn the config index.js file Just import the following code proxyTable: { '/api': { target: 'http://localhost:3000', //The backend interface to be accessed changeOrigin: true, pathRewrite: { '^/api': '/' //The configuration here is a regular expression. The one starting with /api will be replaced with '/api'. If the interface of the backend document is /api/list/xxx //The front-end API interface is written as: axios.get('/api/list/xxx'), and the actual access after processing is: http://news.baidu.com/api/list/xxx } }}, The port number of vue server startup is different every timeYesterday I ran a project given by a friend on my computer. Since he was using vue3.0 and I was using vue2.5.2, there was an error message when running his project. It might be a version problem. I followed the error message to download the plug-in, and his project worked. But since then, every time I run my project, I find that the port number is different. Solution:First download npm install [email protected] Reinstall dependencies npm install Restart the project npm run dev The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Solve the black screen problem after VMware installs Linux system and starts
>>: A simple method to merge and remove duplicate MySQL tables
Copy code The code is as follows: <!DOCTYPE ht...
Table of contents Overview 1. Clearly understand ...
Method 1: Use Google advanced search, for example...
What is an index? Why create an index? Indexes ar...
Table of contents Overview 1. Compositon API 1. W...
This article introduces the sample code for imple...
Table name and fields –1. Student List Student (s...
Table of contents Preface $attrs example: $listen...
Sometimes you need to install certain dependencie...
After reading the following article, you can depl...
Preface Today, I was reviewing the creational pat...
For security reasons, MySql-Server only allows th...
Preface During project development, due to differ...
The front-end development department is growing, ...
Detailed explanation of Linux LVM logical volume ...