From 17de76464987c9ec5803e6303d1f5269420633d1 Mon Sep 17 00:00:00 2001 From: Dipun Mistry Date: Sun, 4 Sep 2022 16:20:27 +0100 Subject: [PATCH] Allow configurability of host port --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index dc746db..95806e9 100644 --- a/main.go +++ b/main.go @@ -40,6 +40,11 @@ func main() { mux.HandleFunc("/ln", lnurlw_response) mux.HandleFunc("/cb", lnurlw_callback) - err := http.ListenAndServe(":9000", mux) + port := os.Getenv("HOST_PORT") + if len(value) == 0 { + port := "9000" + } + + err := http.ListenAndServe(":" + port, mux) log.Fatal(err) }