From 2967fad99777ec87d037c5c0bf1bed58d33ea0be Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sat, 14 Nov 2020 01:45:53 +0100 Subject: [PATCH] testing bugs --- climate-server.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/climate-server.go b/climate-server.go index 223c256..0a34a14 100644 --- a/climate-server.go +++ b/climate-server.go @@ -41,14 +41,14 @@ func teardown() { func startServer() { port := "8001" r := mux.NewRouter() - r.HandleFunc("/", showCharts).Methods("GET") - r.HandleFunc("/", showCharts).Methods("GET").Queries("show-minutes", "{[0-9]+}") - r.HandleFunc("/", saveSnapshot).Methods("POST") - r.HandleFunc("/data", sendData).Methods("GET") - r.HandleFunc("/data", sendData).Methods("GET").Queries("since", "") - r.HandleFunc("/data/now", createAndSendSnapshot).Methods("GET") - r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("static/")))) - http.Handle("", r) + r.HandleFunc("", showCharts).Methods("GET") + r.HandleFunc("", showCharts).Methods("GET").Queries("show-minutes", "{[0-9]+}") + r.HandleFunc("", saveSnapshot).Methods("POST") + r.HandleFunc("data", sendData).Methods("GET") + r.HandleFunc("data", sendData).Methods("GET").Queries("since", "") + r.HandleFunc("data/now", createAndSendSnapshot).Methods("GET") + r.PathPrefix("static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("static/")))) + http.Handle("/", r) fmt.Printf("Listening on port %s...\n", port) quitSnapshot := make(chan int, 1) go saveSnapshotOnInterval(30, quitSnapshot)