about summary refs log tree commit diff
diff options
context:
space:
mode:
-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)