object Companion
source · line 10public
public companion
Explicit listener-ownership construction.
function listen
source · line 12public
public suspend fun listen(application: HttpApplication, scope: CoroutineScope, port: Int = 8080, host: IpAddress = IpAddress.IPV4_LOOPBACK, options: HttpServerOptions = httpServerOptions()): HttpServer
Binds on the current event loop and starts this application in the supplied scope.
parameter options
source · line 17public
options: HttpServerOptions = httpServerOptions()
parameter port
source · line 15public
port: Int = 8080
parameter host
source · line 16public
host: IpAddress = IpAddress.IPV4_LOOPBACK
parameter application
source · line 13public
application: HttpApplication
parameter scope
source · line 14public
scope: CoroutineScope
function listen
source · line 35public
public suspend fun listen(scope: CoroutineScope, port: Int = 8080, host: IpAddress = IpAddress.IPV4_LOOPBACK, options: HttpServerOptions = httpServerOptions(), applicationOptions: HttpApplicationOptions = httpApplicationOptions(), configure: RouterBuilder.() -> Unit): HttpServer
Configures and freezes routes before binding, using the same server and lifecycle.
parameter port
source · line 37public
port: Int = 8080
parameter applicationOptions
source · line 40public
applicationOptions: HttpApplicationOptions = httpApplicationOptions()
parameter scope
source · line 36public
scope: CoroutineScope
parameter options
source · line 39public
options: HttpServerOptions = httpServerOptions()
parameter host
source · line 38public
host: IpAddress = IpAddress.IPV4_LOOPBACK
parameter configure
source · line 41public
configure: RouterBuilder.() -> Unit
function takeOwnership
source · line 52public
public suspend fun takeOwnership(listener: AsyncTcpListener, application: HttpApplication, scope: CoroutineScope, options: HttpServerOptions = httpServerOptions()): HttpServer
Takes the listener after registering the server owner in the supplied active scope.
parameter listener
source · line 53public
listener: AsyncTcpListener
parameter application
source · line 54public
application: HttpApplication
parameter options
source · line 56public
options: HttpServerOptions = httpServerOptions()
parameter scope
source · line 55public
scope: CoroutineScope