Hey!
So I just came across this for the first time after using Ktor for a while, and I'm sure someone will have run into this before and knows the most idiomatic way of solving it.
I've got a route that I want to handle for both put and post, and I was wondering if there's a way of handling both methods without using the more general
handle {}
, because I really like the DSL for
get{}
,
put{}
,
post{}
...etc
o
orangy
01/10/2019, 12:12 PM
Not at the moment, but I think it can be done by making
route
function accept varargs of method:
Current:
Copy code
fun Route.route(path: String, method: HttpMethod, build: Route.() -> Unit): Route