server

fun server(port: Int, block: Server.() -> Unit = {}): Server

Creates and configures a Jetty Server listening on port on every interface.

Return

the configured Server instance.

Parameters

port

the port number the server will listen on; 0 lets the OS choose one.

block

an optional lambda with Server as receiver for configuring the server.


fun server(port: Int, host: String?, block: Server.() -> Unit = {}): Server

Creates and configures a Jetty Server with one ServerConnector listening on port at host.

Return

the configured Server instance.

Parameters

port

the port number the server will listen on; 0 lets the OS choose one.

host

the address to bind, such as "127.0.0.1", or null for every interface.

block

an optional lambda with Server as receiver for configuring the server.