a.k.a Responding to different url paths
Happstack provides a variety of ways to match on parts of the Request (such as the path or request method) and respond appropriately.
Happstack provides two different systems for mapping the request path to a handler. In this section we will cover a simple, untyped routing system. Later in the crash course we will look at fancier, type-safe routing sytem known as web-routes.
#include "MonadPlus.lhs"SimpleHTTP includes a number of other useful routing filters, such as:
nullDir :: (ServerMonad m, MonadPlus m) => m ()host :: (ServerMonad m, MonadPlus m) => String -> m a -> m awithHost :: (ServerMonad m, MonadPlus m) => (String -> m a) -> m auriRest :: (ServerMonad m) => (String -> m a) -> m aanyPath :: (ServerMonad m, MonadPlus m) => m r -> m rtrailingSlash :: (ServerMonad m, MonadPlus m) => m ()/. Useful for distinguishing between foo and foo/