From 6f2519f5229ed8f037f0c062490cd2191e57da9c Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Fri, 18 Oct 2024 08:37:36 -0700 Subject: Add a game. --- roseh.moe.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'roseh.moe.go') diff --git a/roseh.moe.go b/roseh.moe.go index ce66f73..5ce4258 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -47,6 +47,17 @@ func index(w http.ResponseWriter, _ *http.Request) { } } +//go:embed templates/pong.html.template +var pongString string + +var pongTemplate = template.Must(template.New("pong").Parse(pongString)) + +func pong(w http.ResponseWriter, _ *http.Request) { + if err := pongTemplate.Execute(w, nil); err != nil { + log.Printf("Warning: pong: %s", err) + } +} + //go:embed static var staticFiles embed.FS @@ -65,6 +76,7 @@ func main() { flag.Parse() mux := http.NewServeMux() + mux.HandleFunc("/pong", pong) jellyfinURL, err := url.Parse("http://localhost:8096") if err != nil { log.Fatalf("Jellyfin URL: %s", err) -- cgit v1.3.1