mirror of
https://github.com/trafficlunar/api.git
synced 2026-06-27 22:24:08 +00:00
feat: add getting visitor counter
This commit is contained in:
parent
0f2d805df2
commit
bd31a363df
4 changed files with 58 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue