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"
:> QueryParam' '[Required] "offset" Text
:> Get '[JSON] UTCTime
:<|> "mimi"
:> Get '[JSON] Text
server :: Server Api
server = compute
server = compute :<|> helloMimi
where
compute :: Text -> Handler UTCTime
compute x = do
@ -29,6 +31,8 @@ server = compute
Just req -> do
res <- liftIO $ shiftTime req
pure res
helloMimi :: Handler Text
helloMimi = pure "Hello, Mimi"
data ShiftTimeRequest = ShiftTimeRequest
{ shiftSeconds :: Int