serve

fun serve(settings: HttpServerSettings = HttpServerSettings(), handlers: HttpHandler): HttpServer

Create a Jetty server and start it. It is a shortcut to avoid passing the adapter.

Return

The started HttpServer instance.

Parameters

settings

Server settings info .

handlers

List of HttpHandler handlers used in this server instance.


fun serve(settings: HttpServerSettings = HttpServerSettings(), block: HandlerBuilder.() -> Unit): HttpServer

Create a Jetty server and start it. It is a shortcut to avoid passing the adapter.

Return

The started HttpServer instance.

Parameters

settings

Server settings info.

block

Lambda to be used to create the list of HttpHandler handlers used in the server.