sdeleuze
06/26/2017, 9:44 AM@Bean
fun apiRouter() = router {
method(OPTIONS) { ALLOW_CROSS_ORIGIN_RESPONSE }
method(POST).nest {
contentType(APPLICATION_JSON, this@ApiRoutes::myHandler)
}
}
or
@Bean
fun apiRouter() = router {
method(OPTIONS) { ALLOW_CROSS_ORIGIN_RESPONSE }
(method(POST) and contentType(APPLICATION_JSON)).invoke(this@ApiRoutes::myHandler)
}