Added metrics route

This commit is contained in:
2025-06-17 12:05:58 +02:00
parent 4844e946d3
commit cbafd785b9
8 changed files with 173 additions and 56 deletions

View File

@@ -35,6 +35,10 @@ func main() {
controller.GetWeather(res, req, &cache.WeatherCache, &vars)
})
http.HandleFunc("/metrics/", func(res http.ResponseWriter, req *http.Request) {
controller.GetMetrics(res, req, &cache.MetricsCache, &vars)
})
listenAddr := fmt.Sprintf(":%s", port)
log.Printf("Server listening on %s", listenAddr)
http.ListenAndServe(listenAddr, nil)