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 @@
-