From 6b0385c495b246859d27bfa75e1bd4dfa45c2be2 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Fri, 23 May 2025 22:25:49 -0500 Subject: support /watch?v= --- main.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 160230b..511d7d6 100644 --- a/main.go +++ b/main.go @@ -61,14 +61,17 @@ func commentThreadsHandler(w http.ResponseWriter, r *http.Request) { } func handler(w http.ResponseWriter, r *http.Request) { - path := strings.Trim(r.URL.Path, "/") - if path == "" { - path = "world" + id := strings.Trim(r.URL.Path, "/") + //if path == "" { + // TODO landing page + //} + if id == "watch" { + id = r.URL.Query().Get("v") } data := struct { Id string }{ - Id: path, + Id: id, } err := tmpl.Execute(w, data) if err != nil { -- cgit v1.2.3