<@U7ZAXNA5T> Looks good. Additionally since `mongo...
# codereview
r
@Dan Looks good. Additionally since
mongoClient.runCommand
is also async by nature and catches it's own exceptions, do you actually need coroutines here at all?
Copy code
fun health(mongo: MongoClient): (RoutingContext) -> Unit = { ctx ->
  mongoClient.runCommand("ping", json { obj("ping" to 1) }, {
    if (it.succeeded())
      ctx.response().endWithJson(result)
    else {
      val errorObj = json { obj("error" to it.cause().message) }
      ctx.response().statusCode = 500
      ctx.response().endWithJson(errorObj)
    }
 }
}