RoutingHttpHandler

Composite HttpHandler which can potentially service many different URL patterns. Should return a 404 Response if it cannot service a particular Request.

Note that generally there should be no reason for the API user to implement this interface over and above the implementations that already exist. The interface is public only because we have not found a way to hide it from the API user in an API-consistent manner.

Inheritors

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun Events.and(next: Events): Events
infix fun Router.and(that: Router): Router
Link copied to clipboard
fun (Request) -> Boolean.asRouter(description: String = unavailable.description): Router

Convert any predicate on a request into a router

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun HttpHandler.debug(out: PrintStream = System.out, debugStream: Boolean = false): (request: Request) -> Response
fun RoutingHttpHandler.debug(out: PrintStream = System.out, debugStream: Boolean = false): RoutingHttpHandler
Link copied to clipboard
abstract operator fun invoke(request: request: Request): Response
Link copied to clipboard
abstract fun match(request: Request): RouterMatch

Attempt to supply an HttpHandler which can service the passed request.

Link copied to clipboard
fun Events.then(next: Events): (Event) -> Unit
Link copied to clipboard

Convert a synchronous HttpHandler API to mimic AsyncHttpClient

Link copied to clipboard
abstract override fun withBasePath(new: String): RoutingHttpHandler

Returns a Router which prepends the passed base path to the logic determining the match().

Link copied to clipboard
abstract override fun withFilter(new: Filter): RoutingHttpHandler

Returns a Router which applies the passed Filter to all received requests before servicing them.