Skip to content

Home

com.hexagonkt.http.server / Router

Router

class Router

TODO Document. TODO Index routes (ie: GET /foo) TODO Map with routes to all handlers needed Creates and initializes a Router based on a code block.

Parameters

block - Router's setup block.

Return A new router initialized by the passed block.

Constructors

Name Summary
<init> Router(block:Router.() ->Unit= {})
TODO Document. TODO Index routes (ie: GET /foo) TODO Map with routes to all handlers needed Creates and initializes a Router based on a code block.

Properties

Name Summary
requestHandlers var requestHandlers:List<RequestHandler>

Functions

Name Summary
after fun after(path:String= "*", block:RouteCallback):Unit
any fun any(path:String= "/", block:RouteCallback):Unit
before fun before(path:String= "*", block:RouteCallback):Unit
delete fun delete(path:String= "/", block:RouteCallback):Unit
error fun error(code:Int, block:ErrorCodeCallback):Unit
fun error(exception:KClass<Exception>, block:ExceptionCallback):Unit
fun error(exception:Class<Exception>, block:ExceptionCallback):Unit
flatRequestHandlers fun flatRequestHandlers(h:List<RequestHandler> = requestHandlers):List<RequestHandler>
get fun get(path:String= "/", block:RouteCallback):Unit
fun get(resource: Resource):Unit
fun get(path:String, resource: Resource):Unit
fun get(file:File):Unit
fun get(path:String, file:File):Unit
head fun head(path:String= "/", block:RouteCallback):Unit
options fun options(path:String= "/", block:RouteCallback):Unit
patch fun patch(path:String= "/", block:RouteCallback):Unit
path fun path(path: Path, router:Router):Unit
fun path(handler:Router):Unit
fun path(block:Router.() ->Unit):Unit
fun path(path:String, router:Router):Unit
fun path(path:String, block:Router.() ->Unit):Unit
post fun post(path:String= "/", block:RouteCallback):Unit
put fun put(path:String= "/", block:RouteCallback):Unit
trace fun trace(path:String= "/", block:RouteCallback):Unit