summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
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")