Created
August 1, 2010 11:52
-
-
Save moonmaster9000/503268 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TypeFamilies, QuasiQuotes, TemplateHaskell #-} | |
import Yesod | |
data Echo = Echo | |
mkYesod "Echo" [$parseRoutes| | |
/echo/#String EchoR GET | |
|] | |
instance Yesod Echo where approot _ = "" | |
getEchoR s | |
| length s == 4 = permissionDenied "Forbidden: 4 letter word" | |
| otherwise = return $ RepPlain $ toContent s | |
main = basicHandler 3000 Echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment