aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2025-05-23 22:25:49 -0500
committerTim Keller <tjkeller.xyz>2025-05-23 22:25:49 -0500
commit6b0385c495b246859d27bfa75e1bd4dfa45c2be2 (patch)
tree0f2161499a6c72564bd4e730bca8464072f7845e
parent285c3e573e1d01b952342aeaf91aa09303883ebf (diff)
downloadmintube-6b0385c495b246859d27bfa75e1bd4dfa45c2be2.tar.xz
mintube-6b0385c495b246859d27bfa75e1bd4dfa45c2be2.zip
support /watch?v=
-rw-r--r--main.go11
1 files changed, 7 insertions, 4 deletions
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 {