http-server
http-server是基于node.js的一个简单、零配置的命令行web服务器,可以方便实现跨域资源请求, #全局安装: npm install http-server -g; 全局安装后就可以通过命令行来启动了 使用: http-#安装为一个node应用 /-使用: 本地启动http-server: node bin/http-可用的选项: -p:端口号(默认使用8080) -a:address to use(默认使用0.0.0.0) -d:Show directory listings (defaults to 'True') -i:Display autoIndex (defaults to 'True') -e 或 --ext:Default file extension if none supplied (defaults to 'html') -s 或 --silent:Suppress log messages from output --cors:Enable CORS via the `Access-Control-Allow-Origin` header -o:Open browser window after starting the server -c:Set 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. -U 或 --utc:Use UTC time format in log messages. -P 或 --proxy:Proxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com -S 或 --ssl:Enable https. -C 或 --cert:Path to ssl cert file (default: cert.pem). -K 或 --key:Path to ssl key file (default: key.pem). -r 或 --robots:Provide a /robots.txt (whose content defaults to 'User-agent: *nDisallow: /') -h 或 --help:Print this list and exit. (编辑:站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |