Repository navigation
Replies: 1 comment
|
Share the same With koin-ktor 4.2.2, you can bind the application's existing container to the Ktor import io.ktor.server.application.Application
import org.koin.core.Koin
import org.koin.ktor.ext.inject
import org.koin.ktor.plugin.setKoin
fun Application.httpApi(appKoin: Koin) {
setKoin(appKoin)
val service by inject<MyService>()
// Configure routes here; their handlers can use service.
}Pass the container that already owns your Compose application's dependencies when configuring
One lifecycle detail matters: in this version, installing the
This is checked against the 4.2.2 implementation, not a run of your Compose/Ktor project. |
Uh oh!
There was an error while loading. Please reload this page.
I have a compose app(not kmp) with a ktor-server running. How do i inject my app module intances to ktor-server implementation?
All reactions