Hey folks, looking for experiences on DI with Ktor. What's the "typical setup" like - just creating modules (either with Koin/Kodein or manually) and passing them into the extension functions? Has anyone experimented with a library like Kotlin-Inject with Ktor? Thanks in advance!
a
August Lilleaas
08/27/2022, 5:04 PM
I typically don’t do anything fancy here. I like my route handlers to extract necessary stuff from the request and pass it on to functions that handles business logic, and use the return value from those functions to craft a response
August Lilleaas
08/27/2022, 5:18 PM
but you could easily replace my “plain functions” with “get a module and invoke it” from a DI system 🙂