{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module Nero.Application ( slashRedirect ) where import Data.Monoid ((<>)) import Control.Lens import Nero.Request import Nero.Response import Nero.Match import Nero.Url -- $setup -- >>> :set -XOverloadedStrings -- >>> import Nero -- | 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 $ "