There is no `commandLineEnvironment` function in K...
# ktor
r
There is no
commandLineEnvironment
function in Ktor 3 and there is nothing about it in the migration guide. How to migrate this configuration to Ktor 3? https://github.com/rjaros/kilua-dev/blob/main/src/jvmMain/kotlin/website/Main.kt
I've tried this:
Copy code
embeddedServer(CIO, environment = CommandLineConfig(args).environment) {
        install(Compression)
        initSsr()
    }.start(wait = true)
but it doesn't seem to work
I need my app to read configuration with
-config=application.conf
command line parameter
r
I can't use
EngineMain
because my app is run as native graalvm image (at least that's what I think).
This seems to work for me:
Copy code
val config = CommandLineConfig(args)
embeddedServer(CIO, config.environment, {
    takeFrom(config.engineConfig)
    loadCommonConfiguration(config.rootConfig.environment.config.config("ktor.deployment"))
}) {
    install(Compression)
    initSsr()
}.start(wait = true)
👍 1
a
I've created an issue.
thank you color 1
👍 1