https://kotlinlang.org logo
#ktor
Title
# ktor
n

Nick Halase

04/10/2022, 5:33 PM
Why do I often see ktor apps with the routing module using
install(Routing)
and others just declare routing directly? Is the install for the routing module really optional?
s

Sebastian Owodzin

04/10/2022, 8:29 PM
This is why https://github.com/ktorio/ktor/blob/main/ktor-server/ktor-server-core/jvmAndNix/src/io/ktor/server/routing/Routing.kt#L145-L147 Basically the first time you use
Copy code
routing {
    ...
}
it will install the plugin if it wasn’t installed already.
5 Views