适用于 Go Web 服务器的实时重载工具
gin is a simple command line utility for live-reloading Go web applications.
Just run gin in your app directory and your web app will be served with
gin as a proxy. gin will automatically recompile your code when it
detects a change. Your app will be restarted the next time it receives an
HTTP request.
gin adheres to the "silence is golden" principle, so it will only complain
if there was a compiler error or if you succesfully compile after an error.
Assuming you have a working Go environment and GOPATH/bin is in your
PATH, gin is a breeze to install:
go install github.com/codegangsta/gin@latest
Then verify that gin was installed correctly:
gin help
gin run main.go
Options
…
gin assumes that your web app binds itself to the PORT environment
variable so it can properly proxy requests to your app. Web frameworks
like Martini do this out of
the box.
When you normally start your server with flags
if you want to override any of them when running gin we suggest you
instead use github.com/namsral/flag
as explained in this post
If you want to still use the standard flag package but support environment variables, you might want to try github.com/peak6/envflag.
暂无开放 Issues,或尚未同步最近议题。