Until now I've only used Ktor to interface with so...
# ktor
e
Until now I've only used Ktor to interface with sockets. I was looking at how to setup a server with routes and stumbled upon this example for "modularization":
Copy code
routing {
    listOrdersRoute()
    getOrderRoute()
    totalizeOrderRoute()
}

fun Route.listOrdersRoute() {
    get("/order") {

    }
}

fun Route.getOrderRoute() {
    get("/order/{id}") {

    }
}

fun Route.totalizeOrderRoute() {
    get("/order/{id}/total") {

    }
}
So basically it means we may potentially end up with a
routing
section with a lot of method calls?
Copy code
routing {
    listOrdersRoute()
    getOrderRoute()
    totalizeOrderRoute()
    // and maybe another hundreds
}
OK I've got my answer here https://ktor.io/docs/structuring-applications.html#group_routing_definitions
If we have tons of routes in our app, this could quickly become long and cumbersome. Since we have however routes grouped by file, we can take advantage of this and define the routing in each file also. For this we could create an extension for Application and define the routes
h
You can also use the routing resources feature to share the routes with a ktor client. But the general design of the modularization is the same.
gratitude thank you 2