summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/main.go b/main.go
index 7cfe341..b9bd1b1 100644
--- a/main.go
+++ b/main.go
@@ -14,7 +14,6 @@ import (
"strconv"
"strings"
- "ricketyspace.net/peach/nws"
"ricketyspace.net/peach/photon"
"ricketyspace.net/peach/version"
"ricketyspace.net/peach/weather"
@@ -93,17 +92,10 @@ func main() {
}
func showWeather(w http.ResponseWriter, lat, lng float32) {
- forecastBundle, nwsErr := nws.GetForecastBundle(lat, lng)
- if nwsErr != nil {
- http.Error(w, nwsErr.Error(), nwsErr.Status)
- }
-
// Make weather
- weather, err := weather.NewWeather(forecastBundle.Point,
- forecastBundle.Forecast,
- forecastBundle.ForecastHourly)
+ weather, err, status := weather.NewWeather(lat, lng)
if err != nil {
- http.Error(w, err.Error(), 500)
+ http.Error(w, err.Error(), status)
return
}