From 5027e0251d862cecbf1d61f27cb20050839e0a0a Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Mon, 17 Jul 2023 10:13:18 -0700 Subject: [PATCH] Remove demo button clickers --- main.go | 12 ------------ static/index.html | 9 +-------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/main.go b/main.go index 780c178..3f39f9e 100644 --- a/main.go +++ b/main.go @@ -19,15 +19,6 @@ func generateHandler(file string, handler func(), data func() any) handler { } } -func generateClick() handler { - var clicks uint = 0 - return generateHandler( - "click.html", - func() { clicks++ }, - func() any { return clicks }, - ) -} - func generateSseHandler(handler func(http.ResponseWriter, *http.Request)) handler { return func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/event-stream") @@ -57,9 +48,6 @@ func generateCounter() handler { func main() { http.Handle("/", http.FileServer(http.Dir("static"))) - http.HandleFunc("/api/click1", generateClick()) - http.HandleFunc("/api/click2", generateClick()) - http.HandleFunc("/api/click3", generateClick()) http.HandleFunc("/api/counter", generateCounter()) log.Fatal(http.ListenAndServe(":3333", nil)) } diff --git a/static/index.html b/static/index.html index 5625853..d7952c6 100644 --- a/static/index.html +++ b/static/index.html @@ -7,13 +7,6 @@ -
-
- -
- -
- -
+
\ No newline at end of file