router.use(MyHandler(Services.SomeService()))private const val PATH = "/some-resources"
class MyHandler(someService: SomeService) : Handler{
override fun register(router: Router) { router.put(PATH).handler(this::handle) }
private fun handle(context: RoutingContext) { // Do stuff with context val someParam context.getParam("someParam")
val result = someService.doSomethingWith(someParam) //output is some string
context .response .setStatusCode(200) .putHeader("Content-Type", "application/json") .end(result) }}