diff options
| author | unwox <me@unwox.com> | 2024-08-23 21:37:59 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2024-08-23 21:37:59 +0600 |
| commit | 260c293cd9c15e1a7da01563f7f6c96c4f2f9ceb (patch) | |
| tree | e1f1729a6f70f7403b944b6605d0e9e483733108 | |
| parent | c8a5f8a68f28e8d910c648d52125f8d28b400b25 (diff) | |
allow to change HTTP-listen address with -l flag
| -rw-r--r-- | main.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -15,6 +15,7 @@ import ( ) func main() { + lAddr := flag.String("l", "127.0.0.1:3000", "Address HTTP-server will listen to") wrksNum := flag.Int("n", runtime.NumCPU(), "Number of HTTP-workers to start") flag.Parse() @@ -168,8 +169,8 @@ func main() { } }() - fmt.Println("luna is running at 127.0.0.1:3002...") - log.Fatal(http.ListenAndServe("127.0.0.1:3002", mux)) + log.Printf("luna is running at %s...", *lAddr) + log.Fatal(http.ListenAndServe(*lAddr, mux)) } func printUsage() { |
