{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE LambdaCase #-} module Nero.Application ( -- * Trailing slash redirection slashRedirect ) where import Nero.Prelude import Nero.Request import Nero.Response import Nero.Match import Nero.Url -- * Trailing slash redirection -- $setup -- >>> :set -XOverloadedStrings -- >>> import Nero -- >>> import Nero.Payload (body) -- | Redirect with slash appended URL if only a trailing slash is needed for -- successful matching, otherwise it responds normally. -- -- >>> let mkRequest p = dummyRequest & host .~ "example.com" & path .~ p -- >>> let respond name = ok $ "