Added wind route and started forecast endpoint

This commit is contained in:
2025-06-17 17:38:31 +02:00
parent cbafd785b9
commit 9e419ec7bf
9 changed files with 378 additions and 18 deletions

View File

@@ -39,6 +39,14 @@ func main() {
controller.GetMetrics(res, req, &cache.MetricsCache, &vars)
})
http.HandleFunc("/wind/", func(res http.ResponseWriter, req *http.Request) {
controller.GetWind(res, req, &cache.WindCache, &vars)
})
http.HandleFunc("/forecast/", func(res http.ResponseWriter, req *http.Request) {
controller.GetForecast(res, req, &cache.ForecastCache, &vars)
})
listenAddr := fmt.Sprintf(":%s", port)
log.Printf("Server listening on %s", listenAddr)
http.ListenAndServe(listenAddr, nil)