用npm来部署快速一个httpweb服务器
2017-02-13 23:01
302 查看
最近经常用到webstormlocalhost 服务 但是有很多不便 第一呢是无法在其他局域网设备上去进行检查 第二是在使用chrome的在线编辑自动保存功能的时候经常会出现一个乱码的问题 所以找到了一个工具 http-server
http-server的安装
http-server的启动
path为网页的根目录他会自动寻找里面的index.html
3. http-server的一些参数
http-server的安装
npm install http-server -g
http-server的启动
http-server [path] [options]
path为网页的根目录他会自动寻找里面的index.html
3. http-server的一些参数
-p Port to use (defaults to 8080) -a Address to use (defaults to 0.0.0.0) -d Show directory listings (defaults to 'True') -i Display autoIndex (defaults to 'True') -g or --gzip When enabled (defaults to 'False') it will serve ./public/some-file.js.gz in place of ./public/some-file.js when a gzipped version of the file exists and the request accepts gzip encoding. -e or --ext Default file extension if none supplied (defaults to 'html') -s or --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 or --utc Use UTC time format in log messages. -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 Enable https. -C or --cert Path to ssl cert file (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: /') -h or --help Print this list and exit.
相关文章推荐
- 高性能Web服务器Nginx的配置与部署研究(10)核心模块之HTTP模块Location相关指令
- 一个c#的与web服务器交互的HttpClient类
- 高性能Web服务器Nginx的配置与部署研究(10)核心模块之HTTP模块Location相关指令
- 快速部署一台WEB服务器(Tomcat9)
- 一个Web应用部署到Tomcat服务器上之后的目录结构是怎样的?以及web工程与maven web工程的目录结构
- 高性能Web服务器Nginx的配置与部署研究(9)核心模块之HTTP模块基本常用指令
- 高性能Web服务器Nginx的配置与部署研究(9)核心模块之HTTP模块基本常用指令
- 将树莓派变成一个web服务器(2):Nginx+Flask+uWSGI部署全过程
- mac端如何快速搭建一个web服务器
- 用tomcat在本地部署一个web服务器
- 高性能Web服务器Nginx的配置与部署研究(10)核心模块之HTTP模块Location相关指令
- Linux CentOS 如何快速部署Web服务器-Apache篇
- 从无到有快速搭建一个基于Web的Mail服务器,能够实现邮件的收发
- 在Eclipse中配置Web服务器,并开发部署一个简单的web应用
- 新写了一个Web即时通程序,基于HTTP长连接的服务器推技术。
- 高性能Web服务器Nginx的配置与部署研究(9)核心模块之HTTP模块基本常用指令
- 关于一个具有配置文件的 Java Project 项目(非 web 项目)在服务器上的一个便捷部署
- 关于一个具有配置文件的 Java Project 项目(非 web 项目)在服务器上的一个便捷部署
- 使用 Chef 自动化部署一个 Web 服务器
- 一个web服务器部署多个项目知多少?