Scaling our routes

When embracing a microservices architecture, or really any scalable software, we want our code to be easy to read, modify, and debug. Currently, our service has its sole route defined directly within the routing {} block of Application.kt. This is fine for a trivial example, but it's not scalable. In this section, we're going to see how we can leverage extension functions to make our routing easier to understand, and we are then going to walk through the process of installing an additional route to our service.

Get Mastering Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.