Running your modules
One you have declared your dependencies with the Koin DSL, you just need to start Koin and inject!
The start function
startKoin() function just need a list of
Module to run and it will load every defintion from your modules. It is a function, it can be used every where, dependening on the used runtime.
External properties can be loaded while starting your modules.
Load from koin.properties
Koin will check if koin.properties is available, to laod your properties. It has to be in
src/main/resources Kotlin folder or
asset Android folder.
For koin core/spark/ktor, you can also load environment properties with the
You can also supply properties on the fly, with the Koin start function with the
Depending on your choosen Koin module, Koin will be launched slight differently.
For a Kotlin app, just start it in your
For an Android app, you will start Koin in your
For a Spark web app, just run it from your
Your dependencies are delcared in modules. You have started Koin. Let’s go with injection!