blaze-html integration for Scotty

Latest on Hackage:0.1.3

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

MIT licensed by William Casarin
Maintained by


blaze-html integration for scotty


blaze :: Html -> ActionM ()

builder :: Builder -> ActionM ()


{-# LANGUAGE OverloadedStrings #-}

import           Web.Scotty
import           Web.Scotty.Blaze
import           Network.Wai.Middleware.RequestLogger
import           Text.Blaze.Html (Html)
import qualified Text.Blaze.Html5 as H
import qualified Data.Text as T
import           Data.Monoid ((<>))

helloHtml :: T.Text -> Html
helloHtml n =
  H.html $ do
    H.head $ do
      H.title greet
    H.body $ do
      H.p greet
    greet = H.toHtml $ "Hello, " <> n

main :: IO ()
main = scotty 3000 $ do
  middleware logStdoutDev
  get "/:name" $ do
    n <- param "name"
    blaze $ helloHtml (T.pack n)
Depends on 6 packages:
Used by 1 package:
comments powered byDisqus