From bace6e7fa4e514b3802921a8da37192b90fde83f Mon Sep 17 00:00:00 2001 From: ari melody Date: Sun, 10 Nov 2024 05:41:03 +0000 Subject: [PATCH] respect config port --- main.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index 4e27f4c..8e8839a 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,6 @@ import ( "net/http" "os" "path/filepath" - "strconv" "time" "arimelody-web/admin" @@ -67,12 +66,8 @@ func main() { // start the web server! mux := createServeMux() - port, err := strconv.ParseInt(os.Getenv("ARIMELODY_PORT"), 10, 0) - if err != nil { - port = DEFAULT_PORT - } - fmt.Printf("Now serving at http://127.0.0.1:%d\n", port) - log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), global.HTTPLog(mux))) + fmt.Printf("Now serving at http://127.0.0.1:%d\n", global.Config.Port) + log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", global.Config.Port), global.HTTPLog(mux))) } func createServeMux() *http.ServeMux {