wai-extra-0.3.3: Provides some basic WAI handlers and middleware.

Network.Wai.Middleware.Rewrite

Synopsis

Documentation

rewrite :: (ByteString -> IO ByteString) -> MiddlewareSource

rewrite based on your own conversion rules Example usage: rewrite (autoHtmlRewrite static)

autoHtmlRewrite :: String -> ByteString -> IO ByteStringSource

example rewriter implements 2 rules for static html re-writes 1) for a directory foo, check for fooindex.html 2) for a non-directory bar, check for bar.html if the file exists, do the rewrite