一、使用serve服務(wù)啟動
1,安裝serve
npm install -g serve
2.進入項目目錄,啟動
serve -s -d -n -l 5000 (5000是指定的端口號)
需要切換到項目目錄下執(zhí)行以上命令:

執(zhí)行結(jié)果:

--help?可以查看命令幫助

二、使用nginx作為服務(wù)啟動
1.安裝nginx(見連接)
2.配置
vim? /etc/nginx/nginx.conf
加入如下配置:
server {
? ? ? ? ? ? ? ? listen 443;
? ? ? ? ? ? ? ? server_name? xx.xxx.com;
? ? ? ? ? ? ? ? root /var/www/web-cloud;
? ? ? ? ? ? ? ? ssl_certificate "/xxx.pem";
? ? ? ? ? ? ? ?ssl_certificate_key "/xxx.key";
? ? ? ? ? ? ? ?ssl_protocols? ? ? TLSv1 TLSv1.1 TLSv1.2;
? ? ? ? ?????ssl_ciphers? ? ? ? HIGH:!aNULL:!MD5;
? ? ? ? ? ? ? ? index index.html;
? ? ? ? ? ? ? ? location ~ ^/favicon\.ico$ {
? ? ? ? ? ? ? ? ? ? ? ? root /var/www/web-cloud;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? location / {
? ? ? ? ? ? ? ? ? ? ? ? try_files $uri $uri/ @fallback;
? ? ? ? ? ? ? ? ? ? ? ? index index.html;
? ? ? ? ? ? ? ? ? ? ? ? proxy_set_header? Host? ? ? ? ? ? $host;
? ? ? ? ? ? ? ? ? ? ? ? proxy_set_header? X-Real-IP? ? ? ? $remote_addr;
? ? ? ? ? ? ? ? ? ? ? ? proxy_set_header? X-Forwarded-For? $proxy_add_x_forwarded_for;
? ? ? ? ? ? ? ? ? ? ? ? proxy_set_header? X-Forwarded-Proto? $scheme;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? location @fallback {
? ? ? ? ? ? ? ? ? ? ? ? rewrite ^.*$ /index.html break;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? access_log? /opt/local/access.log? main;
? ? ? ? }