From 0d32b71317472ab5d93aa98f8db02609ed1318bc Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Thu, 26 Mar 2020 21:18:30 +0000 Subject: Allow listening on a specific address The address is read from the ADDR environment variable. Defaults to every address. --- gcp/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcp/main.go') diff --git a/gcp/main.go b/gcp/main.go index c5c8466..bb792cc 100644 --- a/gcp/main.go +++ b/gcp/main.go @@ -31,5 +31,5 @@ func main() { port = "8080" } http.HandleFunc("/", redirect) - log.Fatal(http.ListenAndServe(":"+port, nil)) + log.Fatal(http.ListenAndServe(os.Getenv("ADDR")+":"+port, nil)) } -- cgit v1.2.3-70-g09d2