In a Ktor server, is it possible to define a base ...
# ktor
j
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:
Copy code
routing {
    get("/orders") {
v1 being the base path.
t
AFAIK
Copy code
route("v1") {
    get("/orders") { ... }
}
a
Yeah, routes can be nested to avoid duplication. For more information read the Routing article in the documentation.