diff options
| author | Hannes Schulze <contact@haschu.me> | 2026-10-03 20:16:24 +0200 |
|---|---|---|
| committer | Hannes Schulze <contact@haschu.me> | 2026-10-03 20:16:24 +0200 |
| commit | 0d43caf82404abc610a56520bfe7ef15559ce2c5 (patch) | |
| tree | 6c632a2c25d00f87f664c0e5f53dfe2e719fe388 /cgi | |
| parent | 883ade0987dc9f5fb7206244b00fa76a46e50ecd (diff) | |
output html
Diffstat (limited to 'cgi')
| -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) |
