A route is a holder for a set of criteria which determine whether an HTTP request or failure should be routed to a handler.
Anything
Object
Route
Basic
Identifiable
Object
Anything
no subtypes hierarchy
Initializer |
Route(Route unknown) |
Inherited Attributes |
Attributes inherited from: Object hash , string |
Methods | |
blockingHandler | shared default Route blockingHandler(Anything(RoutingContext) requestHandler) Like blockingHandler called with ordered = true |
blockingHandler | shared default Route blockingHandler(Anything(RoutingContext) requestHandler, Boolean ordered) Specify a blocking request handler for the route. This method works just like handler excepted that it will run the blocking handler on a worker thread so that it won't block the event loop. Note that it's safe to call context.next() from the blocking handler as it will be executed on the event loop context (and not on the worker thread. If the blocking handler is ordered it means that any blocking handlers for the same context are never executed concurrently but always in the order they were called. The default value of ordered is true. If you do not want this behaviour and don't mind if your blocking handlers are executed in parallel you can set ordered to false. Parameters:
|
consumes | shared default Route consumes(String contentType) Add a content type consumed by this route. Used for content based routing. Parameters:
|
disable | shared default Route disable() Disable this route. While disabled the router will not route any requests or failures to it. |
enable | shared default Route enable() Enable this route. |
failureHandler | shared default Route failureHandler(Anything(RoutingContext) failureHandler) Specify a failure handler for the route. The router routes failures to failurehandlers depending on whether the various criteria such as method, path, etc match. There can be only one failure handler for a route. If you set this more than once it will overwrite the previous handler. Parameters:
|
getPath | shared default String? getPath() @return the path prefix (if any) for this route |
handler | shared default Route handler(Anything(RoutingContext) requestHandler) Specify a request handler for the route. The router routes requests to handlers depending on whether the various criteria such as method, path, etc match. There can be only one request handler for a route. If you set this more than once it will overwrite the previous handler. Parameters:
|
last | shared default Route last() Specify this is the last route for the router. |
method | shared default Route method(HttpMethod method) Add an HTTP method for this route. By default a route will match all HTTP methods. If any are specified then the route will only match any of the specified methods Parameters:
|
order | shared default Route order(Integer order) Specify the order for this route. The router tests routes in that order. Parameters:
|
path | shared default Route path(String path) Set the path prefix for this route. If set then this route will only match request URI paths which start with this path prefix. Only a single path or path regex can be set for a route. Parameters:
|
pathRegex | shared default Route pathRegex(String path) Set the path prefix as a regular expression. If set then this route will only match request URI paths, the beginning of which match the regex. Only a single path or path regex can be set for a route. Parameters:
|
produces | shared default Route produces(String contentType) Add a content type produced by this route. Used for content based routing. Parameters:
|
remove | shared default Route remove() Remove this route from the router |
useNormalisedPath | shared default Route useNormalisedPath(Boolean useNormalisedPath) If true then the normalised request path will be used when routing (e.g. removing duplicate /) Default is true Parameters:
|
Inherited Methods |
Methods inherited from: Object equals |