From f2f14353432c70f11973cdf865a002a267c3bd92 Mon Sep 17 00:00:00 2001 From: Emile Date: Sat, 17 Aug 2024 01:04:10 +0200 Subject: added a version read via env var --- src/battle.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/battle.go') diff --git a/src/battle.go b/src/battle.go index 2723409..7aa949a 100644 --- a/src/battle.go +++ b/src/battle.go @@ -5,6 +5,7 @@ import ( "html/template" "log" "net/http" + "os" "strconv" "strings" "time" @@ -337,6 +338,7 @@ func battlesHandler(w http.ResponseWriter, r *http.Request) { case "GET": // define data data := map[string]interface{}{} + data["version"] = os.Getenv("VERSION") data["pagelink1"] = Link{Name: "battle", Target: "/battle"} data["pagelink1options"] = []Link{ {Name: "bot", Target: "/bot"}, @@ -385,6 +387,7 @@ func battleNewHandler(w http.ResponseWriter, r *http.Request) { case "GET": // define data data := map[string]interface{}{} + data["version"] = os.Getenv("VERSION") // breadcrumb foo session, _ := globalState.sessions.Get(r, "session") @@ -540,6 +543,7 @@ func battleSingleHandler(w http.ResponseWriter, r *http.Request) { case "GET": // define data data := map[string]interface{}{} + data["version"] = os.Getenv("VERSION") data["pagelink1"] = Link{"battle", "/battle"} data["pagelink1options"] = []Link{ {Name: "user", Target: "/user"}, -- cgit 1.4.1