Move visit to only happen on index
This commit is contained in:
parent
337d4cf9a1
commit
9dab909103
1 changed files with 4 additions and 4 deletions
|
|
@ -154,16 +154,16 @@ func SetupAuth() {
|
||||||
|
|
||||||
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
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)
|
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 {
|
switch true {
|
||||||
case r.Method == "GET" && r.URL.Path == "/favicon.ico":
|
case r.Method == "GET" && r.URL.Path == "/favicon.ico":
|
||||||
getStaticFile("./client/favicon.ico", "image/png", w)
|
getStaticFile("./client/favicon.ico", "image/png", w)
|
||||||
|
|
||||||
case r.Method == "GET" && r.URL.Path == "/":
|
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)
|
getStaticFile("./client/index.html", "text/html", w)
|
||||||
|
|
||||||
case r.Method == "GET" && r.URL.Path == "/rsvp":
|
case r.Method == "GET" && r.URL.Path == "/rsvp":
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue