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

@ -8,6 +8,8 @@ import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"backend/internal/handler"
)
func NewRouter() {
@ -24,6 +26,9 @@ func NewRouter() {
http.Redirect(w, r, "https://axolotlmaid.com", http.StatusPermanentRedirect)
})
r.Get("/visitor-counter", handler.HandleGetVisitorCounter)
r.Patch("/visitor-counter", handler.HandlePatchVisitorCounter)
slog.Info("Starting server", slog.Any("port", os.Getenv("PORT")))
http.ListenAndServe(":"+os.Getenv("PORT"), r)
}