yesod/examples/helloworld.lhs
2010-02-03 16:23:32 +02:00

20 lines
410 B
Plaintext

\begin{code}
{-# LANGUAGE QuasiQuotes #-}
import Yesod
import Network.Wai.Handler.SimpleServer
data HelloWorld = HelloWorld
instance Yesod HelloWorld where
resources = [$mkResources|
/:
Get: helloWorld
|]
helloWorld :: Handler HelloWorld ChooseRep
helloWorld = applyLayout' "Hello World" $ cs "Hello world!"
main :: IO ()
main = putStrLn "Running..." >> toWaiApp HelloWorld >>= run 3000
\end{code}