最近玩了下web項目,需要部署到本地查看效果。
一:准備
1.安裝python或者安裝node.js
2.html項目文件
二:python搭建
1.進入html文件的路徑
2.通過python命令部署
python -m http.server
默認端口8000,如果需要修改端口則命令改為
python -m http.server 9000
三.通過node.js命令部署
安裝http服務
cmd運行以下命令安裝
npm install http-server -g
然后開始部署
1.進入html文件路徑
2.執行命令
http-server
3.修改端口
http-server -p 9090