Chih
Kodein.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>) { ... }
routes
romainbsl
allInstances
allInstances(tag: Any? = null)
A modern programming language that makes developers happier.