1. Package front-end and back-end projects
Points to note
The joint debugging of the front-end and back-end must be changed to the online address of the front-end and front
-end. Then the database-related matters must be changed to the online database.
Release your own firewall and don’t forget to
open both the Pagoda panel and the Alibaba Cloud server (Tencent Cloud server).
front end
You must change the address you requested.
Pack
Open packaeg.json and click build
After packaging, a dist folder will be generated
. Find a directory and put the files in dist below
, but remember what directory you put it in.
Deploy front-end website
Click to add site
Solve cross-domain
#请求中带上/api的都会被转发到我们的后端地址
location /api {
add_header 'Access-Control-Allow-Origin' '*';
#这里是你要代理的地址
proxy_pass http://120.78.71.148:8080;
}
#加上这句防止我们的页面丢失
if (!-e $request_filename) {
rewrite ^(.*)$ /index.html?s=/$1 last;
break;
}
rear end
How to create a database
Import the data table (you can use navicat to help us import data)
Configure redis (if used in your project)
If you haven’t downloaded it, download one directly.
redis configuration
#bind 0.0.0.0
protected-mode no
requirepass yt
Pack
Put the packaged code in a directory.
It is recommended to put it in the following directory.
Then open the terminal and start it.