Added wind route and started forecast endpoint
This commit is contained in:
8
main.go
8
main.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user