命令行Web服務器:http-server

bgn4 9年前發布 | 22K 次閱讀 Node.js 開發 http-server

http-server 是簡單的零配置命令行 http 服務器。

命令行Web服務器:http-server

提供的選項:

-pPort to use (defaults to 8080)

-aAddress to use (defaults to 0.0.0.0)

-dShow directory listings (defaults to 'True')

-iDisplay autoIndex (defaults to 'True')

-eor--extDefault file extension if none supplied (defaults to 'html')

-sor--silentSuppress log messages from output

--corsEnable CORS via theAccess-Control-Allow-Originheader

-oOpen browser window after staring the server

-cSet cache time (in seconds) for cache-control max-age header, e.g. -c10 for 10 seconds (defaults to '3600'). To disable caching, use -c-1.

-Por--proxyProxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com

-Sor--sslEnable https.

-Cor--certPath to ssl cert file (default: cert.pem).

-Kor--keyPath to ssl key file (default: key.pem).

-ror--robotsProvide a /robots.txt (whose content defaults to 'User-agent: *\nDisallow: /')

-hor--helpPrint this list and exit.

項目主頁:http://www.baiduhome.net/lib/view/home/1430836936804

 本文由用戶 bgn4 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!