a.k.a Responding to different url paths
Happstack provides a variety of ways to match on parts of the request and respond appropriately. One simple system is the use of the guard functions in SimpleHTTP.
#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/