vertx.http.route documentation

Functions for operating on Vertx.x RouteMatcher.
RouteMatchers allows you to do route requests based on the HTTP
verb and the request URI, in a manner similar Sinatra or Express.

RouteMatchers also let you extract parameters from the request URI
either a via simple pattern or using regular expressions for more
complex matches. Any parameters extracted will be added to the
requests parameters which will be available to you in your request
handler.

all

(all pattern handler)(all matcher pattern handler)
Specify a handler that will be called for a matching HTTP ALL.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP ALL. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.

connect

(connect pattern handler)(connect matcher pattern handler)
Specify a handler that will be called for a matching HTTP CONNECT.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP CONNECT. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.

delete

(delete pattern handler)(delete matcher pattern handler)
Specify a handler that will be called for a matching HTTP DELETE.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP DELETE. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.

get

(get pattern handler)(get matcher pattern handler)
Specify a handler that will be called for a matching HTTP GET.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP GET. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.

head

(head pattern handler)(head matcher pattern handler)
Specify a handler that will be called for a matching HTTP HEAD.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP HEAD. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.

matcher

(matcher)
Create a RouteMatcher instance.

no-match

(no-match handler)(no-match matcher handler)
Specify a handler that will be called when no other handlers match.
handler can either be a single-arity fn or a Handler instance that
will be called with the HttpServerRequest object If this handler is
not specified. Default behaviour is to return a 404.

options

(options pattern handler)(options matcher pattern handler)
Specify a handler that will be called for a matching HTTP OPTIONS.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP OPTIONS. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.

patch

(patch pattern handler)(patch matcher pattern handler)
Specify a handler that will be called for a matching HTTP PATCH.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP PATCH. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.

post

(post pattern handler)(post matcher pattern handler)
Specify a handler that will be called for a matching HTTP POST.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP POST. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.

put

(put pattern handler)(put matcher pattern handler)
Specify a handler that will be called for a matching HTTP PUT.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP PUT. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.

trace

(trace pattern handler)(trace matcher pattern handler)
Specify a handler that will be called for a matching HTTP TRACE.

If no matcher is provided, a new one will be created. pattern can
either be a simple pattern or regular expression. handler can
either be a single-arity fn or a Handler instance that will be
called with the HttpServerRequest object.

To use a simple pattern to extract parameters simply prefix the
parameter name in the pattern with a ':' (colon) For more complex
matches regular expressions can be used in the pattern. When
regular expressions are used, the extracted parameters do not
have a name, so they are put into the HTTP request with names of
param0, param1, param2 etc. Multiple matches can be specified
for each HTTP TRACE. In the case there are more than one matching
patterns for a particular request, the first matching one will be
used.  Returns the matcher.