Add GET /mimi to zoo

Proving to my girlfriend that the zoo works.
This commit is contained in:
William Carroll 2020-08-14 12:41:08 +01:00
parent 309c5452e1
commit ace08853e0

View file

@ -18,9 +18,11 @@ import qualified Network.Wai.Handler.Warp as Warp
type Api = "run" type Api = "run"
:> QueryParam' '[Required] "offset" Text :> QueryParam' '[Required] "offset" Text
:> Get '[JSON] UTCTime :> Get '[JSON] UTCTime
:<|> "mimi"
:> Get '[JSON] Text
server :: Server Api server :: Server Api
server = compute server = compute :<|> helloMimi
where where
compute :: Text -> Handler UTCTime compute :: Text -> Handler UTCTime
compute x = do compute x = do
@ -29,6 +31,8 @@ server = compute
Just req -> do Just req -> do
res <- liftIO $ shiftTime req res <- liftIO $ shiftTime req
pure res pure res
helloMimi :: Handler Text
helloMimi = pure "Hello, Mimi"
data ShiftTimeRequest = ShiftTimeRequest data ShiftTimeRequest = ShiftTimeRequest
{ shiftSeconds :: Int { shiftSeconds :: Int