node: anywhere随启随用的静态文件服务器

发布时间:2019-06-23 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了node: anywhere随启随用的静态文件服务器脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

Anywhere 随启随用的静态文件服务器

Running static file server anywhere. 随时随地将你的当前目录变成一个静态文件服务器的根目录。

安装

Install it as a command line tool via npm -g.

npm install anywhere -g

运行

$ anywhere
// or with port
$ anywhere -p 8000
// or start it but silent(don't open browser)
$ anywhere -s
// or with hostname
$ anywhere -h localhost -p 8888
// or with folder
$ anywhere -d ~/git/anywhere
// or enable html5 history
$ anywhere -f /index.html

查看帮助

$ anywhere --help
Usage:
  anywhere --help // print help information
  anywhere // 8000 as default port, current folder as root
  anywhere 8888 // 8888 as port
  anywhere -p 8989 // 8989 as port
  anywhere -s // don't open browser
  anywhere -h localhost // localhost as hostname
  anywhere -d /home // /home as root
  anywhere -f /index.html  // Enable html5 history,the index is /index.html

访问方式

http://localhost:8000
执行命令后,默认浏览器将为您自动打开主页。

参考: anywhere

脚本宝典总结

以上是脚本宝典为你收集整理的node: anywhere随启随用的静态文件服务器全部内容,希望文章能够帮你解决node: anywhere随启随用的静态文件服务器所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: