-- | Add a wai-routes handler
handler :: HandlerS DefaultMaster DefaultMaster -> RouteM ()
handler h = middleware $ customRouteDispatch dispatcher' DefaultMaster
  where
    dispatcher' env req = runHandler h env (Just $ DefaultRoute $ getRoute req) req
    getRoute req = (pathInfo $ waiReq req, readQueryString $ queryString $ waiReq req)

-- | Add a route to the application.
-- Routes are ordered so the one declared earlier is matched first.
handler :: HandlerS DefaultMaster DefaultMaster -> RouteM ()
handler h = middleware $ customRouteDispatch dispatcher' DefaultMaster
  where
    dispatcher' env req = runHandler h env (Just $ DefaultRoute $ getRoute req) req
    getRoute req = (pathInfo $ waiReq req, readQueryString $ queryString $ waiReq req)

-- | Add a route to the application.
-- Routes are ordered so the one declared earlier is matched first.
handler h = middleware $ customRouteDispatch dispatcher' DefaultMaster
  where
    dispatcher' env req = runHandler h env (Just $ DefaultRoute $ getRoute req) req
    getRoute req = (pathInfo $ waiReq req, readQueryString $ queryString $ waiReq req)

-- | Add a route to the application.
-- Routes are ordered so the one declared earlier is matched first.