I don't know if Ktor maintainers saw my library b...
# server
t
I don't know if Ktor maintainers saw my library but there is a powerful library in your hands that can be extended to more scenarios than Client and Server 😄 https://github.com/programadorthi/kotlin-routing
p
One question, sorry for not going through the whole code. But how well would it nest another router? The impression I got is the Ktor routing is a global router, when used in ktor server. But in a ui type of App, if I have many modules each with its own router, let's say like graphs in the jetpack compose world. How well these router nest? Is supported out of the box?
🙌 1
t
The main goal of the library is the
core
module. It is the Ktor Server Core module modified to be multi-platform and generic. So, for now, there is no modules for other router systems (Voyager is a multiplatform navigation library, to help with that). Maybe in the future, but is not the main library goal. To support other routes and Kotlin Routing been the owner, you need to do:
Copy code
// In a common module
val router = routing {
    route(path = "/something") {
        handle {
            // Your common router behavior
        }
    }
}

// In an Android Module
router.handle(path = "/android-path") {
    // composeNavigator            
    // ActivityNavigator
    // FragmentNavigator
}

// In an iOS Module
router.handle(path = "/ios-path") {
    // UINavigationController            
}

// In a Web Module
router.handle(path = "/web-path") {
    // React Router
    // Vuew Router
    // Web History API
}
p
I got you thanks. Yeah I know of Voyager, I cloned it the other day. Playing with it.
K 1