Change GET /mimi to GET /hello
Timing myself to see how long it takes me to publish a change.
This commit is contained in:
parent
d903afeb54
commit
b984a2d1e0
1 changed files with 8 additions and 4 deletions
12
zoo/Main.hs
12
zoo/Main.hs
|
@ -18,11 +18,12 @@ import qualified Network.Wai.Handler.Warp as Warp
|
|||
type Api = "run"
|
||||
:> QueryParam' '[Required] "offset" Text
|
||||
:> Get '[JSON] UTCTime
|
||||
:<|> "mimi"
|
||||
:<|> "hello"
|
||||
:> QueryParam "name" Text
|
||||
:> Get '[JSON] Text
|
||||
|
||||
server :: Server Api
|
||||
server = compute :<|> helloMimi
|
||||
server = compute :<|> hello
|
||||
where
|
||||
compute :: Text -> Handler UTCTime
|
||||
compute x = do
|
||||
|
@ -31,8 +32,11 @@ server = compute :<|> helloMimi
|
|||
Just req -> do
|
||||
res <- liftIO $ shiftTime req
|
||||
pure res
|
||||
helloMimi :: Handler Text
|
||||
helloMimi = pure "Hello, Mimi"
|
||||
hello :: Maybe Text -> Handler Text
|
||||
hello mName =
|
||||
case mName of
|
||||
Nothing -> pure "Hello, world!"
|
||||
Just name -> pure $ RIO.Text.concat ["Hello, ", name]
|
||||
|
||||
data ShiftTimeRequest = ShiftTimeRequest
|
||||
{ shiftSeconds :: Int
|
||||
|
|
Loading…
Reference in a new issue