命令行Web服务器:http-server

bgn4 9年前

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.open-open.com/lib/view/home/1430836936804