Adam Brown
11/01/2024, 8:09 AMdevelopmentMode
inside of applicationEngineEnvironment
, but that no longer seems to be an option, anyone know how I can do it for ktor 3?Aleksei Tirman [JB]
11/01/2024, 8:21 AMServerConfig
instance to the embeddedServer
. Here is an example:
fun Application.module() {
routing {
get {
call.respondText { "okay" }
}
}
}
fun main() {
embeddedServer(
Netty,
serverConfig {
developmentMode = true
module(Application::module)
},
configure = {
connector { port = 12345 }
}
).start(wait = true)
}
Aleksei Tirman [JB]
11/01/2024, 8:23 AMAdam Brown
11/01/2024, 8:24 AMpublic fun <TEngine : ApplicationEngine, TConfiguration : ApplicationEngine.Configuration> embeddedServer(
factory: ApplicationEngineFactory<TEngine, TConfiguration>,
environment: ApplicationEnvironment = applicationEnvironment(),
configure: TConfiguration.() -> Unit = {},
module: Application.() -> Unit = {}
): EmbeddedServer<TEngine, TConfiguration> {
val applicationProperties = serverConfig(environment) {
module(body = module)
}
return embeddedServer(factory, applicationProperties, configure)
}
Adam Brown
11/01/2024, 8:25 AMCoroutineScope
have other arguments that I'd like to use, such as watchPaths
which doesn't seem to be present on the non-coroutinescope onesAdam Brown
11/01/2024, 8:27 AMAdam Brown
11/01/2024, 8:27 AM