diff options
Diffstat (limited to 'cgi/index.hs')
| -rw-r--r-- | cgi/index.hs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/cgi/index.hs b/cgi/index.hs index a15fb99..c01e79d 100644 --- a/cgi/index.hs +++ b/cgi/index.hs @@ -1,4 +1,22 @@ +{-# LANGUAGE OverloadedStrings #-} + import Settlr.Storage +import Network.CGI (runCGI, handleErrors, CGIResult, CGI, outputFPS) +import Text.Blaze.Html5 (Html, (!)) +import qualified Text.Blaze.Html5 as H +import qualified Text.Blaze.Html5.Attributes as A +import Text.Blaze.Html.Renderer.Utf8 (renderHtml) + +page :: Html +page = H.docTypeHtml $ do + H.head $ do + H.title "Test" + H.meta ! A.charset "utf-8" + H.body $ do + H.p "Hello, world!" + +cgiMain :: CGI CGIResult +cgiMain = outputFPS $ renderHtml page main :: IO () -main = putStrLn "" +main = runCGI (handleErrors cgiMain) |
