diff --git a/controller.go b/controller.go index 95293c8..2b6eb67 100644 --- a/controller.go +++ b/controller.go @@ -154,16 +154,16 @@ func SetupAuth() { func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { fmt.Printf("%s - [%s] (%s) %s\n", time.Now().Format(time.RFC3339), r.RemoteAddr, r.Method, r.URL) - visit := h.visits.HandleVisit(r.RemoteAddr) - if visit != nil { - h.ntfy.PublishNewVisitNotification(visit) - } switch true { case r.Method == "GET" && r.URL.Path == "/favicon.ico": getStaticFile("./client/favicon.ico", "image/png", w) case r.Method == "GET" && r.URL.Path == "/": + visit := h.visits.HandleVisit(r.RemoteAddr) + if visit != nil { + h.ntfy.PublishNewVisitNotification(visit) + } getStaticFile("./client/index.html", "text/html", w) case r.Method == "GET" && r.URL.Path == "/rsvp":