http-server 是一个简单的零配置命令行http服务器, 基于 nodejs.
如果你不想重复的写 nodejs 的 web-server.js, 则可以使用这个.
安装 (全局安装加 -g) :
npm install http-server
windows 下使用:
在站点目录下开启命令行输入
http-server
访问: http://localhost:8080 or http://127.0.0.1:8080
使用于package.json
"scripts": { "start": "http-server -a 0.0.0.0 -p 8000", }
参数 :
-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: /\\\’) -h or –help 打印以上列表并退出
我这边要备案域名但是域名之前备案过mysql恢复数据库生鲜微信小程序定制打通线上下营销渠道阿里云买了服务器在哪看国企云计算厂商增长迅猛,但私企云下滑域名个人实名认证需要什么证件如何解决谷歌浏览器flash不是最新版本的问题这哥是在西数备案的嘛-备案平台