Skip to content

Instantly share code, notes, and snippets.

@moonmaster9000
Created August 1, 2010 11:52
Show Gist options
  • Save moonmaster9000/503268 to your computer and use it in GitHub Desktop.
Save moonmaster9000/503268 to your computer and use it in GitHub Desktop.
{-# 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