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

    原文作者:Nooboy
    原文地址: https://segmentfault.com/a/1190000017244332
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞