Chih
05/18/2019, 9:12 PMKodein.Module(name = "web") {
bind<Controller>(tag = "health") with singleton { HealthController(instance()) }
bind<Controller>(tag = "user") with singleton { UserController(instance()) }
bind() from singleton { Server(allInstances<Controller>()) }
}
class Server(private val routes: List<Controller>) { ... }
When I debug routes
, it is an empty list.
Thanks in advance!romainbsl
05/19/2019, 8:44 PMromainbsl
05/19/2019, 8:45 PMallInstances
method signature is allInstances(tag: Any? = null)
, by default it returns all the instances of a given type, that are not tagged in the Kodein containerromainbsl
05/19/2019, 8:48 PMromainbsl
05/19/2019, 8:48 PMromainbsl
05/19/2019, 8:48 PMChih
05/20/2019, 1:36 AM