This time I will bring you a detailed explanation of the steps for vue project packaging Uploading to BAE on Baidu. What are the precautions for vue project packaging and uploading to Baidu BAE? The following is a practical case, let’s take a look.
After two days of research, the VUE packaged project was finally released online through BAE. Although there are still some problems with the interface, I am still very happy.
First, let’s talk about the technologies needed for this project, vue+express+git+Baidu’s application engine BAE.
Continuing editing, I finally uploaded the simulated data of the JSON file I wrote.
Specific steps:
1. First, let’s talk about the packaging of the written Vue project (I won’t go into the specific packaging process. Just npm run build will re-create a dist file in the VUE project file. This is the packaged project)
2. Deploying a project on Baidu's application engine BAE costs 2 cents a day, which is very cheap. It’s a great deal to play by yourself.
Detailed steps are introduced in https://cloud.baidu.com/doc/BAE/QuickGuide.html. The GIT version management tool I use. Be sure to select the nodejs0.10.21-web type. Because we use express framework. After creating your own library according to the steps. First, familiarize yourself with its configuration document.
3. Install espress in the library you created, and figure out the specific steps yourself. (The npm install -g express-generator command must be present, otherwise it may prompt that the express command cannot be found)
Next is the highlight. Although it is very simple, I studied it for a long time.
(1) First delete all three files in this file managed by git, except app.conf, and then copy the files in the created express project and put them into git In the managed library, the file name of the library managed by git is basically test1appid245yn4jb32. test1 is the folder I created, and the folder appid245yn4jb32 was cloned remotely from git. Copy all the files in the project created by express, including dependencies, to the appid245yn4jb32 folder. At the same time, add the js suffix to the www file in the bin folder. Because this BAE only recognizes the entry file of .js. At the same time, change the port in the www file to 18080. Because the default port of BAE is 18080.
(2) Copy the packaged project in the vue project (all files under the dist folder) to the public folder, and delete the original one.
In this way, upload all files, open the website, and you should be able to see the things in the vue project. (It just looks like there is no data)
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!
Recommended reading:
How to deal with null parameters in post in vue
##axios cannot accept springMVC when sending a post request How to handle parameters
The above is the detailed content of Detailed explanation of BAE steps for packaging and uploading vue projects to Baidu. For more information, please follow other related articles on the PHP Chinese website!