1.1配置nginx
server { #充电宝商城 listen 8090; server_name localhost; root D:/classification/zhongBang_company/cdbshop-mobile/publish; charset utf-8; index index.html index.htm; location ^~ /api/ { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://localhost:8080/api/; } location ^~ /merchant/ { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://localhost:8080/api/; } location ~ .*\.(htm|html)$ { add_header Cache-Control no-store; } }
1.2启动nginx
2.1需要安装gulp,win+R输入cmd,npm install -g gulp全局安装gulp命令
3.1 进入到项目的build目录,编译项目