Hi, using kotlin, do we have the possibility to wr...
# spring
g
Hi, using kotlin, do we have the possibility to write this code in a more concise way? Here I would like to compose the predicates
method(POST)
and
contentType(APPLICATION_JSON)
without an additional call to
nest
Copy code
@Bean
    open fun apiRouter() = router {
        "/".nest {
            method(OPTIONS, {
                ALLOW_CROSS_ORIGIN_RESPONSE
            })
            method(POST).nest {
                contentType(APPLICATION_JSON) {
                    req -> ::myHandler
                }
            }
        }
    }