yesod/examples/helloworld.lhs
2009-12-17 19:27:03 +02:00

20 lines
380 B
Plaintext

\begin{code}
{-# LANGUAGE QuasiQuotes #-}
import Yesod
import Hack.Handler.SimpleServer
data HelloWorld = HelloWorld
instance Yesod HelloWorld where
handlers = [$resources|
/:
Get: helloWorld
|]
helloWorld :: Handler HelloWorld HtmlObject
helloWorld = return $ cs "Hello world!"
main :: IO ()
main = putStrLn "Running..." >> run 3000 (toHackApp HelloWorld)
\end{code}