HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulewai-extra-3.1.18Haskell2010

Network.Wai.UrlMap

This module gives you a way to mount applications under sub-URIs. For example:

bugsApp, helpdeskApp, apiV1, apiV2, mainApp :: Application

myApp :: Application
myApp = mapUrls $
      mount "bugs"     bugsApp
  <|> mount "helpdesk" helpdeskApp
  <|> mount "api"
          (   mount "v1" apiV1
          <|> mount "v2" apiV2
          )
  <|> mountRoot mainApp
  • 2 types
  • 4 values
newtypenewtype UrlMap' a
#
Instances6Functor, Applicative, Foldable, Traversable, Alternative, ToApplication
valuemount' :: ToApplication a => Path -> a -> UrlMap
#

Mount an application under a given path. The ToApplication typeclass gives you the option to pass either an Application or an UrlMap as the second argument.

valuemount :: ToApplication a => Text -> a -> UrlMap
#

A convenience function like mount', but for mounting things under a single path segment.

valuemountRoot :: ToApplication a => a -> UrlMap
#

Mount something at the root. Use this for the last application in the block, to avoid 500 errors from none of the applications matching.