api

http4k / org.http4k.routing / Router

Router

interface Router

Matches requests for routing purposes.

Properties

Name Summary
description open val description: RouterDescription

Functions

Name Summary
match Attempt to supply an HttpHandler which can service the passed request.abstract fun match(request: Request): RouterMatch
withBasePath Returns a Router which prepends the passed base path to the logic determining the match().open fun withBasePath(new: String): Router
withFilter Returns a Router which applies the passed Filter to all received requests before servicing them.open fun withFilter(new: Filter): Router

Extension Functions

Name Summary
and infix fun Router.and(that: Router): Router
bind infix fun Router.bind(handler: HttpHandler): RoutingHttpHandler
infix fun Router.bind(handler: RoutingHttpHandler): RoutingHttpHandler

Inheritors

Name Summary
ResourceLoading A little convenience thunk to simplify implementing Router for resource loaders.interface ResourceLoading : Router
RoutingHttpHandler Composite HttpHandler which can potentially service many different URL patterns. Should return a 404 Response if it cannot service a particular Request.interface RoutingHttpHandler : Router, HttpHandler