diff options
author | Emile <hanemile@protonmail.com> | 2019-02-25 17:53:00 +0100 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2019-02-25 17:53:00 +0100 |
commit | bdcbc605fe6a0e91acc27e829c3a7933e9fad786 (patch) | |
tree | 5d39dd2d04e294c85b3227e9b71311f28aba6a8e | |
parent | 85d97193985442b0cbaa48294941bd868d9826dd (diff) |
the nfw url is now provided using an enviromental variable
-rw-r--r-- | main.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go index 4171701..7affe0d 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "log" "math/rand" "net/http" + "os" "strconv" "time" ) @@ -19,8 +20,10 @@ type point struct { // make a request to the nfw api and return the result func netNFW(x float64, y float64, z float64) float64 { + var nfwurl = os.Getenv("nfwurl") + // build the request string - var randMinRequestURL string = fmt.Sprintf("http://nfw.docker.localhost/NFW?x=%f&y=%f&z=%f", x, y, z) + var randMinRequestURL string = fmt.Sprintf("http://%s/NFW?x=%f&y=%f&z=%f", nfwurl, x, y, z) // make the request resp, err := http.Get(randMinRequestURL) |