diff --git a/main.go b/main.go index f03ad82..44abea7 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,8 @@ package main import ( "embed" + "flag" + "fmt" "html/template" "io/fs" "log" @@ -12,6 +14,9 @@ import ( var sourceFS embed.FS func main() { + port := flag.Int("port", 8081, "port to listen on") + flag.Parse() + staticRoot, err := fs.Sub(sourceFS, "source") if err != nil { log.Fatal(err) @@ -152,6 +157,8 @@ func main() { mux.Handle("/static/", http.StripPrefix("/static/", http.FileServerFS(assetsRoot))) - log.Println("running on http://localhost:8081/") - log.Fatal(http.ListenAndServe(":8081", mux)) + addr := fmt.Sprintf(":%d", *port) + log.Printf("running on http://localhost%s/\n", addr) + log.Fatal(http.ListenAndServe(addr, mux)) + } diff --git a/site b/site index 38a1d6d..e7dc2ba 100755 Binary files a/site and b/site differ