public static MuHandler route ( Method method , String uriTemplate , RouteHandler muHandler ) { UriPattern uriPattern = UriPattern . uriTemplateToRegex ( uriTemplate ) ; return ( request , response ) -> { boolean methodMatches = method == null || method . equals ( request . method ( ) ) ; if ( methodMatches ) { PathMatch matcher = uriPattern . matcher ( request . relativePath ( ) ) ; if ( matcher . fullyMatches ( ) ) { muHandler . handle ( request , response , matcher . params ( ) ) ; return true ; } } return false ; } ; }
Creates a new handler that will only be called if it matches the given route info .