Almost there
This commit is contained in:
@@ -13,15 +13,15 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ROOT_URL = "/climate"
|
const ROOT_URL = "/climate/"
|
||||||
|
|
||||||
func startServer() {
|
func startServer() {
|
||||||
port := "8001"
|
port := "8001"
|
||||||
router := mux.NewRouter().StrictSlash(true)
|
router := mux.NewRouter().StrictSlash(true)
|
||||||
router.HandleFunc("", showCharts).Methods("GET")
|
router.HandleFunc("/show", showCharts).Methods("GET")
|
||||||
router.HandleFunc("", showCharts).Methods("GET").Queries("show-minutes", "{[0-9]+}")
|
router.HandleFunc("/show", showCharts).Methods("GET").Queries("show-minutes", "{[0-9]+}")
|
||||||
router.HandleFunc("", saveSnapshot).Methods("POST")
|
|
||||||
router.HandleFunc("/data", sendData).Methods("GET")
|
router.HandleFunc("/data", sendData).Methods("GET")
|
||||||
|
router.HandleFunc("/data", saveSnapshot).Methods("POST")
|
||||||
router.HandleFunc("/data", sendData).Methods("GET").Queries("since", "")
|
router.HandleFunc("/data", sendData).Methods("GET").Queries("since", "")
|
||||||
router.HandleFunc("/data/now", createAndSendSnapshot).Methods("GET")
|
router.HandleFunc("/data/now", createAndSendSnapshot).Methods("GET")
|
||||||
router.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("webapp/dist/"))))
|
router.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("webapp/dist/"))))
|
||||||
|
|||||||
Reference in New Issue
Block a user