From 31a871230fde44dab60b989b155b00a055aec42f Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sat, 14 Nov 2020 01:47:17 +0100 Subject: [PATCH] testing bugs --- climate-server.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/climate-server.go b/climate-server.go index 0a34a14..facdab2 100644 --- a/climate-server.go +++ b/climate-server.go @@ -48,11 +48,10 @@ func startServer() { 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) - log.Fatal(http.ListenAndServe(":"+port, nil)) + log.Fatal(http.ListenAndServe(":"+port, r)) } func showCharts(w http.ResponseWriter, r *http.Request) {