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
1. Link layout of the new site homepage 1. The loc...
Background color and transparency settings As sho...
The basic structure of HTML hypertext documents is...
After configuring VIP, the error message that app...
Normally, when you run a command in the terminal,...
Table of contents pom configuration Setting.xml c...
1. Overview Zabbix is a very powerful and most ...
First create a directory cd /etc/nginx mkdir ssl ...
** Detailed graphic instructions for installing y...
The crontab command is used by Unix and Linux to ...
Table of contents Preface think Library directory...
This article records the detailed installation tu...
Table of contents 1. Definition and Use 1.1 Defin...
Fault description percona5.6, mysqldump full back...
Table of contents Image capture through svg CSS p...