app :: ServerPart Response
app = msum [
dir "hello" $ (method GET >> helloGet) <|> (method POST >> helloPost)
, okResponse home
]
.. Assuming ServerPart
has the appropriate Alternative
instance. If it's missing for some reason, you can replace (<|>)
with mplus
. The main idea here is that you're just nesting one routing combinator inside another.