testing bugs
This commit is contained in:
@@ -41,14 +41,14 @@ func teardown() {
|
|||||||
func startServer() {
|
func startServer() {
|
||||||
port := "8001"
|
port := "8001"
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.HandleFunc("/", showCharts).Methods("GET")
|
r.HandleFunc("", showCharts).Methods("GET")
|
||||||
r.HandleFunc("/", showCharts).Methods("GET").Queries("show-minutes", "{[0-9]+}")
|
r.HandleFunc("", showCharts).Methods("GET").Queries("show-minutes", "{[0-9]+}")
|
||||||
r.HandleFunc("/", saveSnapshot).Methods("POST")
|
r.HandleFunc("", saveSnapshot).Methods("POST")
|
||||||
r.HandleFunc("/data", sendData).Methods("GET")
|
r.HandleFunc("data", sendData).Methods("GET")
|
||||||
r.HandleFunc("/data", sendData).Methods("GET").Queries("since", "")
|
r.HandleFunc("data", sendData).Methods("GET").Queries("since", "")
|
||||||
r.HandleFunc("/data/now", createAndSendSnapshot).Methods("GET")
|
r.HandleFunc("data/now", createAndSendSnapshot).Methods("GET")
|
||||||
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("static/"))))
|
r.PathPrefix("static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("static/"))))
|
||||||
http.Handle("", r)
|
http.Handle("/", r)
|
||||||
fmt.Printf("Listening on port %s...\n", port)
|
fmt.Printf("Listening on port %s...\n", port)
|
||||||
quitSnapshot := make(chan int, 1)
|
quitSnapshot := make(chan int, 1)
|
||||||
go saveSnapshotOnInterval(30, quitSnapshot)
|
go saveSnapshotOnInterval(30, quitSnapshot)
|
||||||
|
|||||||
Reference in New Issue
Block a user