Is there a better way to do this, maybe without re...
# codereview
j
Is there a better way to do this, maybe without reflection?
Copy code
fun Router.blockingGet(url: String, handler: KFunction1<@ParameterName(name = "ctx") RoutingContext, Unit>) {
	<http://this.post|this.post>(url).blockingHandler { ctx ->
		handler.invoke(ctx)
	}
}
This is where I’m using it:
Copy code
object HomeController {
	fun default(ctx: RoutingContext) {
		ctx.response().end(":-)")
	}
}
Copy code
router.blockingGet("/", HomeController::default)