In a Ktor server, is it possible to define a base path globally, so it doesn’t need to be included in the path when declaring a route?
E.g. My endpoint is https://example.com/v1/orders
but I want to define the route like:
routing {
get("/orders") {
v1 being the base path.
t
turansky
09/23/2021, 7:10 AM
AFAIK
route("v1") {
get("/orders") { ... }
}
a
Aleksei Tirman [JB]
09/23/2021, 9:15 AM
Yeah, routes can be nested to avoid duplication. For more information read the Routing article in the documentation.