1. 程式人生 > >NodeJS 最快速搭建一個HttpServer anywhere

NodeJS 最快速搭建一個HttpServer anywhere

anywhere 會自動開啟index.html

npm install anywhere -g

cd

想要以某個路徑作為靜態檔案伺服器的根目錄分享,只需要在該目錄下執行:

anywhere 

預設不新增 -s 命令會在命令敲擊後,同時開啟瀏覽器訪問 http://ipv4地址:8000/ 這個路徑。

anywhere -p 8000 // 指定靜態伺服器的埠號  
anywhere -s // 靜默執行,不開啟瀏覽器  

https://www.cnblogs.com/mrblue/p/6149849.html

NodeJS 最快速搭建一個HttpServer

node.js最快速搭建一個HttpServer

 

先下載 http-server

npm install http-server -g

 

在目錄裡放一個index.html

1

2

cd D:\Web\InternalWeb

start http-server -i -p 8081 -a 127.0.0.1