Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (14 sloc) 443 Bytes
{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses,
TemplateHaskell, OverloadedStrings #-}
import Yesod
data HelloWorld = HelloWorld
mkYesod "HelloWorld" [parseRoutes|
/#String HomeR GET
|]
instance Yesod HelloWorld
getHomeR :: String -> Handler RepHtmlJson
getHomeR name = do
let json = object ["name" .= name]
defaultLayoutJson [whamlet|Hello #{name}|] json
main :: IO ()
main = warpDebug 3000 HelloWorld