From 0d43caf82404abc610a56520bfe7ef15559ce2c5 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Sat, 3 Oct 2026 20:16:24 +0200 Subject: output html --- cgi/index.hs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'cgi/index.hs') 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) -- cgit v1.3.1