is there a way to have the routing and different a...
# ktor
p
is there a way to have the routing and different application setups split in different files? big applications are much harder to maintain if everything must go in the same file
s
You can extract the logic to a new extension function
1
Wont that work ?
p
sorry, I'm a starter on ktor, can extension functions go in different files? 😮
I have no idea of how
s
Yes you can call an extension function from a different file
p
I still don't get how to split the different routings into multiple files
I get I can extend the entire routing in a different place, but that's not what I meant
oh my apologies, I think I get it
thanks for your time
r
Can you show an example of the extension function? I saw that in the docs too, but they don’t provide an example. Is it an extension on ApplicationCallPipeline?
s
Just select the code and refactor -> extract -> function