diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2020-03-26 21:18:30 +0000 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2020-03-26 21:18:30 +0000 |
| commit | 0d32b71317472ab5d93aa98f8db02609ed1318bc (patch) | |
| tree | 2c641f5d4e81d177db4d23867d36c83fd1d7c277 /gcp/main.go | |
| parent | 0ea3c6452a7a93e8a228aa522f356aaa604bc478 (diff) | |
Allow listening on a specific address
The address is read from the ADDR environment variable. Defaults to
every address.
Diffstat (limited to 'gcp/main.go')
| -rw-r--r-- | gcp/main.go | 2 |
1 files changed, 1 insertions, 1 deletions
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)) } |
