orangy
pet
, category
, city
, etc I could make a loop something like this:
val restEntities = mapOf("pets" to Pet::class, “category” to Category::class, …)
routes {
restEntities.forEach { (path, type) ->
get(path) { call.respondJson(repository.list(type) }
post(path) { repository.add(call.request.content.toJson(type)) }
…
}
}
Something like this