route
Builds a route to match the specified regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Example:
route(Regex("/(?<number>\\d+)")) {
get("/hello") {
val number = call.parameters["number"]
...
}
}
Content copied to clipboard
Builds a route to match the specified HTTP method and regex path. Named parameters from regex can be accessed via ApplicationCall.parameters.
Example:
route(Regex("/(?<name>.+)/hello"), HttpMethod.Get) {
handle {
val name = call.parameters["name"]
...
}
}
Content copied to clipboard
Builds a route to match the specified path.
See also
Builds a route to match the specified HTTP method and path.