Allow configurability of host port

This commit is contained in:
Dipun Mistry 2022-09-04 16:20:27 +01:00 committed by GitHub
parent 6ebd94762b
commit 17de764649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,6 +40,11 @@ func main() {
mux.HandleFunc("/ln", lnurlw_response) mux.HandleFunc("/ln", lnurlw_response)
mux.HandleFunc("/cb", lnurlw_callback) 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) log.Fatal(err)
} }