I want to make an abstraction layer over Ktor, tha...
# ktor
d
I want to make an abstraction layer over Ktor, that the routing should only be for extracting and passing params to the controller class that has no Ktor dep., and should handle the return from a controller which is something like:
Copy code
sealed class ServerResponse {
	object Empty : ServerResponse()

	data class Error(val statusCode: Int, val message: String, val exception: Exception? = null) : ServerResponse()

	data class Json(val jsonObj: Any) : ServerResponse() {
		val jsonString: String
			get() = Klaxon().toJsonString(jsonObj)
	}
}