How to use coroutine inside the router.route(“/api/*”).handler?
问题 I am trying to use coroutine inside the route handler lambda as follows: private suspend fun createRoutes(router: Router, auth: OAuth2Auth): Unit { val oauth2 = OAuth2AuthHandler.create(vertx, auth) val authz = KeycloakAuthorization.create() router.route().handler(LoggerHandler.create()) router.route("/api/*").handler(oauth2) router.route("/api/greet").handler { println(RoleBasedAuthorization.create("ad-admins").match(it.user())) authz.getAuthorizations(it.user()).await() } } The compiler