Does anyone have a sample code for Kodein with Kto...
# ktor
t
Does anyone have a sample code for Kodein with Ktor? Thanks
d
Not official samples AFAIK. If someone has a sample, would be really nice a PR for the ktor-samples repo ­čÖé https://github.com/ktorio/ktor-samples
­čĹŹ 1
d
I simply use
val kodein = Kodein { }
in a DI.kt at root, and then as close as possible to the call site I do
val registrationController: RegistrationController by kodein.instance()
-- all the other deps are injected by constructor in modules imported in the main Kodein block...