From bdcbc605fe6a0e91acc27e829c3a7933e9fad786 Mon Sep 17 00:00:00 2001
From: Emile <hanemile@protonmail.com>
Date: Mon, 25 Feb 2019 17:53:00 +0100
Subject: the nfw url is now provided using an enviromental variable

---
 main.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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)
-- 
cgit 1.4.1