Thank you for the advice, I did it. I did not use bindings, but used fmap rqServerName getRequest and if-then-else . This is a piece of code.
skite :: Snap () skite = do req <- fmap rqServerName getRequest routes req where routes req = if (req == "www.site1.ro") then (site1) else pass <|> if (req == "site1.ro") then (site1) else pass <|> if (req == "www.site2.ro") then (writeBS req) else pass <|> if (req == "site2.ro") then (writeBS "Nowhere to be found") else pass <|> ifTop (writeBS req)
I also created the point with the full code here. For further suggestions, please.
source share