Nikky
02/25/2022, 3:25 PMhttps://nikky.catgirl.host/i/x00fif8f.png▾
embeddedServer
call chain and add a custom KtorSimpleLogger
implementationAleksei Tirman [JB]
02/27/2022, 8:46 AMNativeApplicationEngineEnvironment
and pass it as the environment
argument in the embeddedServer
call. Here is an example:
embeddedServer(
CIO,
NativeApplicationEngineEnvironment(
log = logger,
config = MapApplicationConfig(),
connectors = mutableListOf(EngineConnectorBuilder().apply {
port = 9090
}),
modules = mutableListOf({
routing {
get("/") {
call.respondText { "Hello" }
}
}
}),
parentCoroutineContext = EmptyCoroutineContext,
rootPath = "/",
developmentMode = false
)
) {
}.start(wait = true)
Nikky
02/27/2022, 12:25 PMserver = embeddedServer(
factory = CIO,
environment = applicationEngineEnvironment {
log = KtorKLogger()
connectors += EngineConnectorBuilder().apply {
host = serverOptions.host
port = serverOptions.port
}
module {
configureHTTP()
configureRouting()
}
}
)
server.start(wait = false)
Aleksei Tirman [JB]
02/27/2022, 12:29 PM