From 2f2239ddd85775f366c0e8f5fcf4bb40d1c09ec8 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Mon, 20 Apr 2020 10:15:45 +0200 Subject: Factor out endpoints --- lib/Web/OpenWeatherMap/API.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Web/OpenWeatherMap/API.hs b/lib/Web/OpenWeatherMap/API.hs index 6d06421..b9624f8 100644 --- a/lib/Web/OpenWeatherMap/API.hs +++ b/lib/Web/OpenWeatherMap/API.hs @@ -27,10 +27,10 @@ type GetForecastWeather = AppId :> Get '[ JSON] ForecastWeather type AppId = QueryParam "appid" String type Current - = "weather" :> QueryParam "q" String :> GetCurrentWeather :<|> "weather" :> QueryParam "lat" Double :> QueryParam "lon" Double :> GetCurrentWeather + = "weather" :> (QueryParam "q" String :> GetCurrentWeather :<|> QueryParam "lat" Double :> QueryParam "lon" Double :> GetCurrentWeather) type Forecast - = "forecast" :> QueryParam "q" String :> GetForecastWeather :<|> "forecast" :> QueryParam "lat" Double :> QueryParam "lon" Double :> GetForecastWeather + = "forecast" :> (QueryParam "q" String :> GetForecastWeather :<|> QueryParam "lat" Double :> QueryParam "lon" Double :> GetForecastWeather) type API = Current :<|> Forecast -- cgit v1.2.3