I try to migrate from Ktor 2 to Ktor 3. With Ktor ...
# ktor
n
I try to migrate from Ktor 2 to Ktor 3. With Ktor 2 I had a bootstrap code like:
Copy code
val mainCoroutineContext = ...

val environment = applicationEngineEnvironment {
    this.parentCoroutineContext = mainCoroutineContext // (1)
    this.log = ... 
    this.module { ...}
    this.connectors.addAll(...)
}

val applicationEngine = applicationEngineFactory.create(environment) { ... } // (2)

mainCoroutineContext.launch {
    applicationEngine.start(wait = true)
}
But I've found no Ktor 3 equivalent for (1) and (2)... Thanks.
a
I suggest looking into the migration guide.
n
Thanks. I've succeeded with this
embeddedServer()
overload:
Copy code
public fun <TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration> embeddedServer(
    factory: ApplicationEngineFactory<TEngine, TConfiguration>,
    applicationProperties: ApplicationProperties,
    configure: TConfiguration.() -> Unit = {}
): EmbeddedServer<TEngine, TConfiguration> {