summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorunwox <me@unwox.com>2024-08-23 21:37:59 +0600
committerunwox <me@unwox.com>2024-08-23 21:37:59 +0600
commit260c293cd9c15e1a7da01563f7f6c96c4f2f9ceb (patch)
treee1f1729a6f70f7403b944b6605d0e9e483733108 /main.go
parentc8a5f8a68f28e8d910c648d52125f8d28b400b25 (diff)
allow to change HTTP-listen address with -l flag
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.go b/main.go
index 4cbc7c9..923260d 100644
--- a/main.go
+++ b/main.go
@@ -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() {