aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorhovertank3d <[email protected]>2025-01-17 17:31:09 +0100
committerhovertank3d <[email protected]>2025-01-17 17:31:09 +0100
commitf60aec7f3669d9cd2e099d75b9d4ccd37035da57 (patch)
tree8d54fb17bb98eb0f19f9508df93e5592d57238ef /main.go
parent234a2ba96aeb91fb30603a90de22d71fc29632dd (diff)
downloadlzcnt.space-f60aec7f3669d9cd2e099d75b9d4ccd37035da57.tar.xz
lzcnt.space-f60aec7f3669d9cd2e099d75b9d4ccd37035da57.zip
implement reset button
Diffstat (limited to 'main.go')
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index 7eba79e..b7ae65c 100644
--- a/main.go
+++ b/main.go
@@ -31,6 +31,11 @@ func main() {
log.Fatal(err)
}
+ http.HandleFunc("/reset", func(w http.ResponseWriter, r *http.Request) {
+ counter.Store(0)
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ })
+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
n := counter.Add(1)
payload := struct {