1:簡介:
命令行服務器。
2:優點:簡潔,輕便。
3:安裝:
4:配置:
標紅的位置說明:
5:參數說明:
-p 端口號 (默認 8080)
-a IP 地址 (默認 0.0.0.0)
-d 顯示目錄列表 (默認 'True')
-i 顯示 autoIndex (默認 'True')
-e or --ext 如果沒有提供默認的文件擴展名(默認 'html')
-s or --silent 禁止日志信息輸出
--cors 啟用 CORS via the Access-Control-Allow-Origin header
-o 在開始服務后打開瀏覽器
-c 為 cache-control max-age header 設置Cache time(秒) , e.g. -c10 for 10 seconds (defaults to '3600'). 禁用 caching, 則使用 -c-1.
-U 或 --utc 使用UTC time 格式化log消息
-P or --proxy Proxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com
-S or --ssl 啟用 https
-C or --cert ssl cert 文件路徑 (default: cert.pem)
-K or --key Path to ssl key file (default: key.pem).
-r or --robots Provide a /robots.txt (whose content defaults to 'User-agent: *\nDisallow: /')
官方文檔:
https://www.npmjs.com/package/http-server
建議:
所有的node插件,要想詳細了解,建議去官網看,盡管都是英文,但是正規。