有时候网页地址栏需要用到http协议,这个时候就可以通过http-server来达到效果。
安装
npm install -g http-server
运行在要成为服务器的目录下运行如下命令
http-server
若要禁用缓存,请使用如下命令运行
http-server -c-1
运行后在浏览器输入
http://localhost:8080/或者http://127.0.0.1:8080
npm install -g http-server
http-server
http-server -c-1
http://localhost:8080/或者http://127.0.0.1:8080