diff --git a/server.go b/server.go index 67d9c86..fdc3659 100644 --- a/server.go +++ b/server.go @@ -13,15 +13,15 @@ import ( "time" ) -const ROOT_URL = "/climate" +const ROOT_URL = "/climate/" func startServer() { port := "8001" router := mux.NewRouter().StrictSlash(true) - router.HandleFunc("", showCharts).Methods("GET") - router.HandleFunc("", showCharts).Methods("GET").Queries("show-minutes", "{[0-9]+}") - router.HandleFunc("", saveSnapshot).Methods("POST") + router.HandleFunc("/show", showCharts).Methods("GET") + router.HandleFunc("/show", showCharts).Methods("GET").Queries("show-minutes", "{[0-9]+}") router.HandleFunc("/data", sendData).Methods("GET") + router.HandleFunc("/data", saveSnapshot).Methods("POST") router.HandleFunc("/data", sendData).Methods("GET").Queries("since", "") router.HandleFunc("/data/now", createAndSendSnapshot).Methods("GET") router.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("webapp/dist/"))))