feat: add incrementing visitor counter

This commit is contained in:
axolotlmaid 2024-09-25 18:22:51 +01:00
parent afcd4e9a8a
commit a92db04713
3 changed files with 41 additions and 5 deletions

View file

@ -14,5 +14,8 @@ func HandleGetVisitorCounter(w http.ResponseWriter, r *http.Request) {
}
func HandlePatchVisitorCounter(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("hello world"))
data := service.IncrementVisitorCounter()
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
}