Changed endpoints and db queries, chart now shows suggested mins and maxes

This commit is contained in:
Daniel Ledda
2020-11-07 01:32:18 +01:00
parent 26a2cd1f4a
commit 297e0ab465

View File

@@ -41,7 +41,7 @@ func startServer() {
r.HandleFunc("/data/since/{mins}", sendData).Methods("GET") r.HandleFunc("/data/since/{mins}", sendData).Methods("GET")
r.HandleFunc("/data/last/", sendLastSnapshot).Methods("GET") r.HandleFunc("/data/last/", sendLastSnapshot).Methods("GET")
r.HandleFunc("/", saveSnapshot).Methods("POST") r.HandleFunc("/", saveSnapshot).Methods("POST")
r.PathPrefix("/static/").Handler(http.StripPrefix("/" + ROOT_URL + "/static/", http.FileServer(http.Dir("static/")))) r.PathPrefix("/static/").Handler(http.StripPrefix("/" + ROOT_URL + "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)
log.Fatal(http.ListenAndServe(":"+port, nil)) log.Fatal(http.ListenAndServe(":"+port, nil))