Configurable bind address, support for paths

This commit is contained in:
Ian Gulliver
2020-11-24 23:04:34 +00:00
parent 31509efd16
commit 650c835234
2 changed files with 10 additions and 9 deletions

View File

@@ -128,6 +128,7 @@ func main() {
rand.Seed(time.Now().UnixNano())
keyFlag := flag.String("key", "", "secret key")
bindFlag := flag.String("bind", ":2000", "host:port to listen on")
flag.Parse()
@@ -153,7 +154,7 @@ func main() {
http.HandleFunc("/api/watch", watch)
server := http.Server{
Addr: ":2000",
Addr: *bindFlag,
}
err := server.ListenAndServe()
if err != nil {