From da6097c5e2d9d81cda35412e6f935cdfcc60578a Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Fri, 7 Apr 2023 12:43:06 -0600 Subject: [PATCH] load all into mem --- http.go | 3 +++ public/root.html | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/http.go b/http.go index d552885..c9d1657 100644 --- a/http.go +++ b/http.go @@ -3,6 +3,7 @@ package main import ( "context" _ "embed" + "encoding/json" "fmt" "net/http" "os" @@ -62,5 +63,7 @@ func httpRoot(w http.ResponseWriter, r *http.Request) { } ctx := extract(r.Context()) body = strings.ReplaceAll(body, "{{USER}}", ctx.User) + assignments, _ := json.Marshal(nil) + body = strings.ReplaceAll(body, "{{ASSIGNMENTS_JSON}}", string(assignments)) w.Write([]byte(body)) } diff --git a/public/root.html b/public/root.html index 4fa0ba3..7c73025 100644 --- a/public/root.html +++ b/public/root.html @@ -13,9 +13,21 @@ ).toString(36); console.log("session", session); + {{USER}} +
+ +
+
+ + + +