about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-02-25 17:53:00 +0100
committerEmile <hanemile@protonmail.com>2019-02-25 17:53:00 +0100
commitbdcbc605fe6a0e91acc27e829c3a7933e9fad786 (patch)
tree5d39dd2d04e294c85b3227e9b71311f28aba6a8e
parent85d97193985442b0cbaa48294941bd868d9826dd (diff)
the nfw url is now provided using an enviromental variable
-rw-r--r--main.go5
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)