From b245f4555ef4a4543c40a4d790cba6cb640823d1 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 10 Jul 2020 22:17:11 +0200 Subject: Added home handler again --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index c521203..c498a5f 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,10 @@ import ( "net/http" ) +func handleHome(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("stats OK")) +} + func handleEntryOptions(w http.ResponseWriter, r *http.Request) { w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Methods", "POST") @@ -36,6 +40,7 @@ func handleEntryPost(w http.ResponseWriter, r *http.Request) { func handleRequests() { router := mux.NewRouter() + router.HandleFunc("/", handleHome) router.HandleFunc("/entry", handleEntryPost).Methods("POST") router.HandleFunc("/entry", handleEntryOptions).Methods("OPTIONS") -- cgit v1.1