In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to change the port number of the vuejs project. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
The vuejs port number can be modified in the "index.js" file of the config folder under the root directory, specific method: 1, open the "index.js" file; 2, find the "port:8080" entry, and change the default "8080" port number to the desired port number value.
The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.
Change the port number on which the vue project is running
To execute npm run dev is actually to call package.json in the root directory
After opening package.json, you can find such a piece of code.
"scripts": {"dev": "node build/dev-server.js", "build": "node build/build.js", "lint": "eslint-- ext .js, .vue src"}
Therefore, we should look at the dev-server.js file in the build directory
Can be found in the dev-server.js file
Var uri = 'http://localhost:' + port
The port here is what we are looking for, and we can find it at the beginning of the dev-server.js
Var path = require ('path')
And where did path come from?
There is a config folder in the root directory. If you look at the name, you can see that it is related to the configuration. Open index.js in the config directory.
At this point, you can see that the project is configured with port:8080
At run time, the port number is 8080:
Modify the value, for example, to 4040
All right, it's so simple! You can change not only the port, but also other configuration information as needed.
This is the end of the article on "how to change the port number of the vuejs project". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.