not really known
Go to file
2024-05-16 16:19:23 -06:00
.github/workflows Add 9.2, 9.4, 9.6 CI 2023-06-25 17:30:50 +03:00
example Allow servant-0.13 2018-02-09 19:50:25 +02:00
src/Servant/HTML Merge pull request #12 from Taneb/patch-1 2020-11-04 12:32:20 +03:00
.gitignore extra-source-files: CHANGELOG.md; .gitignore 2019-02-01 12:08:54 +02:00
.stylish-haskell.yaml Add travis, stylish-haskell, remove tinc.yaml 2016-05-13 08:23:21 +03:00
cabal.haskell-ci Add 9.2, 9.4, 9.6 CI 2023-06-25 17:30:50 +03:00
CHANGELOG.md Accept content type without character set 2019-02-01 11:22:32 +02:00
LICENSE Change copyright to servant contributors 2016-01-20 16:58:29 +01:00
README.md Update README.md 2018-06-20 01:04:13 +09:00
servant-blaze.cabal Allow warp-3.4 2024-05-16 16:19:23 -06:00
Setup.hs stylish haskell changes 2015-08-18 00:07:12 +02:00

servant-blaze - Blaze-html support for servant

servant

This package allows you to use blaze-html to serve html pages in your servant APIs. More specifically, it exports a HTML datatype with the correct MimeRender instances so that you can write type API = Get '[HTML] User for example.

Minimal example:

{-# LANGUAGE OverloadedStrings, DataKinds #-}

module Test where

import           Servant
import           Servant.HTML.Blaze
import qualified Text.Blaze.Html5   as H

type API = Get '[HTML] Homepage
type Homepage = H.Html

server :: Server API
server = return myHome

myHome :: Homepage
myHome = H.docTypeHtml $ do
    H.head $ do
             H.title "Live to serve"
    H.body $ do
             H.h1 "Templates!"
             H.p "This will be type-checked, rendered and served"