Safe Haskell | None |
---|---|
Language | Haskell2010 |
The Clacks
middleware adds a X-Clacks-Overhead
header to every response
served by a Wai server.
To use this package to keep the legacy of Terry Pratchett alive, simply
pass your wai application to clacks gnuTerryPratchett
before passing it
to the run
function:
import Network.Wai.Handler.Warp (run) import Network.Wai.Middleware.Clacks (clacks, gnuTerryPratchett) import MyLib.App (myApp) main :: IO () main = run 8080 $ clacks gnuTerryPratchett myApp
You can use the Clacks
type to build a custom configuration for the
clacks
function, allowing you to pass anything into the header:
import Data.List.NonEmpty (NonEmpty(..)) import Network.Wai (Middleware) import Network.Wai.Middleware.Clacks (Clacks(..), clacks) myClacks :: Middleware myClacks = clacks $ Clacks $ "GNU Ada Lovelace" :| ["GNU Hoban Washburne", "GNU Shephard Book"]
For more information about the Clacks or the X-Clacks-Overhead
header,
check out the GNU Terry Pratchett website.
Synopsis
- clacks :: Clacks -> Middleware
- newtype Clacks = Clacks {}
- gnuTerryPratchett :: Clacks
- clacksHeaderName :: HeaderName
Documentation
clacks :: Clacks -> Middleware Source #
A Network.Wai Middleware
that adds a X-Clacks-Overhead
header
containing the messages in the Clacks
configuration.
Configuration for the Clacks WAI Middleware.
Clacks | |
|
gnuTerryPratchett :: Clacks Source #
Sends a Clacks message of GNU Terry Pratchett
.
clacksHeaderName :: HeaderName Source #
The name of the Clacks header.