salvia-1.0.0: Modular web application framework.

Network.Salvia.Handler.Rewrite

Synopsis

Documentation

hLocalRequest :: HttpM Request m => (Http Request :-> b) -> (b -> b) -> m a -> m aSource

Run a handler in a local environment in which the HTTP Request has been modified.

hRewrite :: HttpM Request m => (Uri -> Uri) -> m a -> m aSource

Run an handler in a modified context in which the request Uri has been changed by the specified modifier function. After the handler completes the Uri remains untouched.

hRewritePath :: HttpM Request m => (FilePath -> FilePath) -> m a -> m aSource

Run handler in a context with a modified path.

hRewriteHost :: HttpM Request m => (String -> String) -> m a -> m aSource

Run handler in a context with a modified host.

hRewriteExt :: HttpM Request m => (Maybe String -> Maybe String) -> m a -> m aSource

Run handler in a context with a modified file extension.

hWithDir :: HttpM Request m => String -> m a -> m aSource

Run handler in a context with a modified path. The specified prefix will be prepended to the path.

hWithoutDir :: HttpM Request m => String -> m a -> m aSource

Run handler in a context with a modified path. The specified prefix will be stripped from the path.