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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.