feat: add getting visitor counter

This commit is contained in:
axolotlmaid 2024-09-25 17:55:40 +01:00
parent 0f2d805df2
commit bd31a363df
4 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,18 @@
package handler
import (
"backend/internal/service"
"encoding/json"
"net/http"
)
func HandleGetVisitorCounter(w http.ResponseWriter, r *http.Request) {
data := service.GetVisitorCounter()
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
}
func HandlePatchVisitorCounter(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("hello world"))
}