public interface Router
| Modifier and Type | Method and Description |
|---|---|
Router |
all(HttpRequestHandler request)
Add an listener for all request methods and contexts.
|
Router |
all(String context,
HttpRequestHandler request)
Adds an handler for a specific context.
|
Router |
all(String context,
String requestMethod,
HttpRequestHandler request)
Adds an handler for a specific context and method.
|
Router |
delete(String context,
HttpRequestHandler request)
Add an listener for DELETE request's.
|
Router |
get(String context,
HttpRequestHandler request)
Add an listener for GET request's.
|
Router |
patch(String context,
HttpRequestHandler request)
Add an listener for PATCH request's.
|
Router |
post(String context,
HttpRequestHandler request)
Add an listener for POST request's.
|
Router |
put(String context,
HttpRequestHandler request)
Add an listener for PUT request's.
|
Router |
use(HttpRequestHandler middleware)
Add an middleware which will be called before each request-type listener will be fired.
|
Router |
use(String context,
HttpRequestHandler middleware)
Add an middleware which will be called before each request-type listener will be fired.
|
Router |
use(String context,
String requestMethod,
HttpRequestHandler middleware)
Add an middleware which will be called before each request-type listener will be fired.
|
Router use(HttpRequestHandler middleware)
middleware - An middleware which will be fired on every request-method and path.Router use(String context, HttpRequestHandler middleware)
context - The context where the middleware should listen.middleware - An middleware which will be fired if the context matches the request-path.Router use(String context, String requestMethod, HttpRequestHandler middleware)
context - The context where the middleware should listen for the request handler..requestMethod - And type of request-method eg. GET, POST etc.middleware - An middleware which will be fired if the context matches the request-method- and path.Router all(HttpRequestHandler request)
request - Will be fired on all requests.Router all(String context, HttpRequestHandler request)
context - The context.request - An listener which will be fired if the context matches the request-path.Router all(String context, String requestMethod, HttpRequestHandler request)
context - The context.requestMethod - The request method.request - An listener which will be fired if the context matches the request-path.Router get(String context, HttpRequestHandler request)
context - The context.request - An listener which will be fired if the context matches the request-path.Router post(String context, HttpRequestHandler request)
context - The context.request - An listener which will be fired if the context matches the request-path.Router put(String context, HttpRequestHandler request)
context - The context for the request handler..request - An listener which will be fired if the context matches the request-path.Router delete(String context, HttpRequestHandler request)
context - The context.request - An listener which will be fired if the context matches the request-path.Router patch(String context, HttpRequestHandler request)
context - The context.request - An listener which will be fired if the context matches the request-path.Copyright © 2019. All rights reserved.