testing bugs

This commit is contained in:
Daniel Ledda
2020-11-14 01:48:56 +01:00
parent 31a871230f
commit 2773f9f42c

View File

@@ -41,13 +41,13 @@ 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/"))))
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/"))))
fmt.Printf("Listening on port %s...\n", port)
quitSnapshot := make(chan int, 1)
go saveSnapshotOnInterval(30, quitSnapshot)