Hey guys, is the ktor server route matching functi...
# ktor
a
Hey guys, is the ktor server route matching function exposed? Or anyone can point me in the right direction??
a
Yes, it's exposed. You can use the
RoutingResolveContext
class which requires a
RoutingRoot
and
PipelineCall
(
ApplicationCall
). Here is an example:
Copy code
val plugin = createApplicationPlugin("Plugin") {
    onCall { call ->
        val routing = call.application.plugin(RoutingRoot)
        val context = RoutingResolveContext(routing, call, mutableListOf())
        val result = context.resolve()

        if (result is RoutingResolveResult.Success) {
            println("Resolved: ${result.route}")
        }
    }
}
🙌 1