diff options
-rw-r--r-- | main.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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") |