public class Routes extends Object
MuServerBuilder.addHandler(Method, String, RouteHandler)
for a simple way to add a routed handler to a server.Modifier and Type | Method and Description |
---|---|
static MuHandler |
route(Method method,
String uriTemplate,
RouteHandler muHandler)
Creates a new handler that will only be called if it matches the given route info.
|
public static MuHandler route(Method method, String uriTemplate, RouteHandler muHandler)
method
- The method to match, or null
to accept any method.uriTemplate
- A URL template. Supports plain URLs like /abc
or paths
with named parameters such as /abc/{id}
or named parameters
with regexes such as /abc/{id : [0-9]+}
where the named
parameter values can be accessed with the pathParams
parameter in the route handler.muHandler
- The handler to invoke if the method and URI matches.MuHandler
that is only called if the request URI and method matches.MuServerBuilder.addHandler(Method, String, RouteHandler)
Copyright © 2017–2021. All rights reserved.