Stephan Schröder
11/26/2024, 11:26 AMrouting {
...
route(".*".toRegex()) {
handle {
<http://log.info|log.info>("request on unsupported path "+call.request.path())
call.respond(HttpStatusCode.NotFound)
}
}
}
but the log output that matching ".*".toRegex() creates is kind of ugly, so I wonder if there's something equivalent like
routing {
...
defaultRoute {
handle {
<http://log.info|log.info>("request on unsupported path "+call.request.path())
call.respond(HttpStatusCode.NotFound)
}
}
}
?Aleksei Tirman [JB]
11/26/2024, 11:28 AMStephan Schröder
11/26/2024, 11:36 AMStephan Schröder
11/26/2024, 12:15 PMinline fun Route.defaultRoute(crossinline handler: Route.()->Unit): Route = this.route("{...}") {
handler()
}
so that the routing config itself looks exactly as I envisioned 🤓