embeddedServer

fun <TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration> embeddedServer(factory: ApplicationEngineFactory<TEngine, TConfiguration>, port: Int = 80, host: String = "0.0.0.0", watchPaths: List<String> = listOf(WORKING_DIRECTORY_PATH), configure: TConfiguration.() -> Unit = {}, module: Application.() -> Unit): TEngine

Creates an embedded server with the given factory, listening on host:port

Parameters

watchPaths

specifies path substrings that will be watched for automatic reloading

configure

configuration script for the engine

module

application module function


fun <TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration> CoroutineScope.embeddedServer(factory: ApplicationEngineFactory<TEngine, TConfiguration>, port: Int = 80, host: String = "0.0.0.0", watchPaths: List<String> = listOf(WORKING_DIRECTORY_PATH), parentCoroutineContext: CoroutineContext = EmptyCoroutineContext, configure: TConfiguration.() -> Unit = {}, module: Application.() -> Unit): TEngine

Creates an embedded server with the given factory, listening on host:port

Parameters

watchPaths

specifies path substrings that will be watched for automatic reloading

configure

configuration script for the engine

parentCoroutineContext

specifies a coroutine context to be used for server jobs

module

application module function


fun <TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration> CoroutineScope.embeddedServer(factory: ApplicationEngineFactory<TEngine, TConfiguration>, vararg connectors: EngineConnectorConfig = arrayOf(EngineConnectorBuilder()), watchPaths: List<String> = listOf(WORKING_DIRECTORY_PATH), parentCoroutineContext: CoroutineContext = EmptyCoroutineContext, configure: TConfiguration.() -> Unit = {}, module: Application.() -> Unit): TEngine

Creates an embedded server with the given factory, listening on given connectors

Parameters

connectors

default listening on 0.0.0.0:80

watchPaths

specifies path substrings that will be watched for automatic reloading

parentCoroutineContext

specifies a coroutine context to be used for server jobs

configure

configuration script for the engine

module

application module function


Creates an embedded server with the given factory, environment and configure script