node: anywhere隨啓隨用的靜態文件服務器

Anywhere 隨啓隨用的靜態文件服務器

Running static file server anywhere. 隨時隨地將你的當前目錄變成一個靜態文件服務器的根目錄。html

安裝

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

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
執行命令後,默認瀏覽器將爲您自動打開主頁。

參考: anywheregit

相關文章
相關標籤/搜索