https://kotlinlang.org logo
#ktor
Title
v

Vinicius Carvalho

07/20/2018, 4:08 PM
Hi all, is there any samples of integrating ktor and kodein?
d

Deactivated User

07/20/2018, 4:09 PM
o

orangy

07/20/2018, 4:15 PM
Search works! :)
👍 1
🎊 1
v

Vinicius Carvalho

07/20/2018, 4:19 PM
Carlos thanks, I saw that, but it was still not very clear to me. I'm still trying to wrap my head on the bootstraping of both frameworks. At first I thought on making a main class of kodein to actually start the embedded server, but I could not figure out how to inject that dependencies on modules started by ktor. The other way around it would be having ktor start the modules, and one of them being the DI module, but not sure how other modules would benefit from constructor injection. I'm sorry, but I'm new to both frameworks, I have been a long time spring user (and committer )
d

Deactivated User

07/20/2018, 4:20 PM
Ok. Since this seems to be recurrent, and nobody proposed a sample yet, I’m going to prepare one myself
Did a sample application showing how to use kodein with pure extension functions and how to test it, and did another example showing how to do something similar to “M(VC)” with classes and stuff. Though how to use it is totally up to you, since ktor doesn’t impose a way for doing things
v

Vinicius Carvalho

07/20/2018, 5:30 PM
This is perfect, thank you
5 Views