In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
Today, the editor will share with you the relevant knowledge points about how to solve the port inconsistency before and after vue. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.
The front and rear ports of vue are inconsistent.
In the config index.js file
Just introduce the following code
ProxyTable: {'/ api': {target: 'http://localhost:3000',// backend interface changeOrigin: true,pathRewrite: {' ^ / api':'/'/ / the configuration here is a regular expression, and the one starting with / api will be replaced with'/ api'. If the interface of the background document is / api/list/xxx// front-end api interface, write: axios.get ('/ api/list/xxx') What is actually accessed after being processed is: the port number of the http://news.baidu.com/api/list/xxx}}},vue startup server is different each time.
Yesterday, I ran the project given by my friend on my computer. Because he used vue3.0 and I used vue2.5.2, I had an error prompt when running his project, and there was a problem with the possible version. I followed the error prompt to download the plug-in. As a result, his project worked well, but since then, I have found that the port number is different every time I execute my project.
Solution:
Download npm install portfinder@1.0.21 first
Reinstall dependency npm install
Restart the project npm run dev
These are all the contents of this article entitled "how to solve the port inconsistency between front and back of vue". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.