added visualisation
This commit is contained in:
@@ -34,7 +34,7 @@ func startServer() {
|
|||||||
port := "8001"
|
port := "8001"
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.HandleFunc("/", showCharts).Methods("GET")
|
r.HandleFunc("/", showCharts).Methods("GET")
|
||||||
r.HandleFunc("/data", sendData).Methods("GET")
|
r.HandleFunc("/data/", sendData).Methods("GET")
|
||||||
r.HandleFunc("/", saveSnapshot).Methods("POST")
|
r.HandleFunc("/", saveSnapshot).Methods("POST")
|
||||||
http.Handle("/", r)
|
http.Handle("/", r)
|
||||||
fmt.Printf("Listening on port %s...\n", port)
|
fmt.Printf("Listening on port %s...\n", port)
|
||||||
@@ -42,7 +42,7 @@ func startServer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func showCharts(w http.ResponseWriter, r *http.Request) {
|
func showCharts(w http.ResponseWriter, r *http.Request) {
|
||||||
http.ServeFile(w, r, "./charts.html")
|
http.ServeFile(w, r, "charts.html")
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendData(w http.ResponseWriter, r *http.Request) {
|
func sendData(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
Reference in New Issue
Block a user