Hi guys, I have a question regarding Roting featur...
# ktor
t
Hi guys, I have a question regarding Roting feature. I am new in ktor, and trying to use different approaches, for instance for every individual entity I have separate package for controller, service etc.. And I am registrating every controller in my RoutingModule like thils
Copy code
fun Application.routingModule() {
    val courtEndpoint by KodeinModule.kodein.instance<CourtEndpointImpl>()
    val userEndpoint by KodeinModule.kodein.instance<UserEndpointImpl>()
    val registrationEndpoint by KodeinModule.kodein.instance<RegistrationEndpointImpl>()
    val companyEndpoint by KodeinModule.kodein.instance<CompanyEndpointImpl>()
    val matchEndpoint by KodeinModule.kodein.instance<MatchEndpointImpl>()

    install(Routing) {
        court(courtEndpoint)
        user(userEndpoint)
        registration(registrationEndpoint)
        company(companyEndpoint)
        match(matchEndpoint)
    }
}
Lets say I will have a lot of entities which means I will registrate every routing in that module and I think it will be look not clear as it could be. Is it any approach, to avoid the situation with registration my routes in install section? Thank you
h
I recently wrote a blog post on routing patterns. https://hadihariri.com/2020/04/02/Routing-in-Ktor/