一個快速、可移植的 Go 命令列實用程序,透過 HTTP 提供檔案目錄。可用於本機 Web 開發、生產靜態網站服務或作為網路文件主機。預設情況下, go-live
提供其執行的目錄。
基於 JavaScript 著名的live-server
實用程式。支援 Linux、Windows 和 Mac,以及 ARM。如果有興趣提供協助,請參閱 TODO 清單。
使用方法:在您想要服務的目錄中,在終端機中執行go-live
。
brew tap antsankov/go-live && brew install go-live
opt/homebrew
。 Brew 預設不會執行此操作,最簡單的方法是透過homebrew
github 發布頁面中的 .pkg 安裝 homebrew。 brew tap antsankov/go-live && arch -arm64 brew install go-live
curl -LJO https://github.com/antsankov/go-live/releases/download/v1.2.1/go-live-mac-x64.zip && unzip go-live-mac-x64.zip && mv go-live /usr/local/bin/go-live && chmod +x /usr/local/bin/go-live && go-live
curl -LJO https://github.com/antsankov/go-live/releases/download/v1.2.1/go-live-mac-arm64.zip && unzip go-live-mac-arm64.zip && mv go-live /usr/local/bin/go-live && chmod +x /usr/local/bin/go-live && go-live
snap install go-live
sudo wget https://github.com/antsankov/go-live/releases/download/v1.2.1/go-live-linux-x32 -O /usr/bin/go-live && sudo chmod +x /usr/bin/go-live
sudo wget https://github.com/antsankov/go-live/releases/download/v1.2.1/go-live-linux-x64 -O /usr/bin/go-live && sudo chmod +x /usr/bin/go-live
sudo wget https://github.com/antsankov/go-live/releases/download/v1.2.1/go-live-linux-arm32 -O /usr/bin/go-live && sudo chmod +x /usr/bin/go-live
sudo wget https://github.com/antsankov/go-live/releases/download/v1.2.1/go-live-linux-arm64 -O /usr/bin/go-live && sudo chmod +x /usr/bin/go-live
docker pull antsankov/go-live
運行(將在連接埠 9000 上提供當前目錄):
docker run --rm -v "${PWD}":/workdir -p 9000:9000 antsankov/go-live go-live
在這裡下載並執行
GO111MODULE=on go get github.com/antsankov/go-live
git clone https://github.com/antsankov/go-live.git && cd go-live
make build && ./bin/go-live
git clone https://github.com/antsankov/go-live.git && cd go-live
make cross-compile && ls release/
gon gon.json
security find-identity -p codesigning
。如果無效,請參閱https://developer.apple.com/forums/thread/86161 - 您需要檢查開發者憑證的資訊以查看是否安裝了「組織單位」憑證。sudo docker build -t antsankov/go-live:v1.2.1 .
和sudo docker push antsankov/go-live:v1.2.1
-h Print help message for go-live
--help
-c Allow browser caching of pages. Can lead to stale results, off by default.
--cache
-d string
Select the directory you want to serve. Serves all subpaths that user has read permissions for. (default "./")
--dir string
(default "./")
-p string
Set port to serve on. (default "9000")
--port string
(default "9000")
-q Quiet stops go-live from opening the browser when started.
--quiet
-s Start in server mode on port 80 and in quiet.
--serve
-v Print the version of go-live.
--version
注意: index.html
會自動顯示在目錄的根目錄下。
範例:透過連接埠 80 提供靜態站點
sudo go-live --dir ~/example.com/ --serve