From 462c7ddc70f7c4da9515298439246f3b40b244f5 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Mon, 12 Dec 2022 22:58:23 +0530 Subject: config: server host and port --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 07d4b67..3f8cad8 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "log" "net/http" @@ -20,5 +21,7 @@ func main() { } mux := routes.Handlers(c) - log.Fatal(http.ListenAndServe(":5555", mux)) + addr := fmt.Sprintf("%s:%d", c.Server.Host, c.Server.Port) + log.Println("starting server on", addr) + log.Fatal(http.ListenAndServe(addr, mux)) } -- cgit