Skip to content
Thiago Santos edited this page Aug 18, 2024 · 6 revisions

Kotlin Routing is the Ktor Server routing system ported to be a multiplatform routing system. The project was inspired before Ktor Server be converted to be multiplatform but it routing system still a specific server behavior.

Please, don't think kotlin routing as a navigation library. There is some integrations to navigation libraries or you can connect your own behavior to a route, but think it as a routing system where you define a route and invoke it only.

Some features:

  • KMP library and it is available in a lot of targets (WASM and Linux support are on the road)
  • Coroutines based library to asynchronous programming by ktor server routing system structure
  • Flexible and extensible because the core have the routing system only and you can create your own behaviors by Ktor plugin very easily
  • A lot of platforms specific frameworks integrations helping how you can use routing and plug-in.

A basic sample:

val router = routing {
    handle(path = "/hello") {
        // Handle the call to the routing "/hello"
    }
}

// And to call hello route
router.call(uri = "/hello")

This basic sample is not enough to show the power of Kotlin Routing.

So, I recommend you follow the sidebar links on the right to getting started