zero_coding
08/22/2020, 9:54 AMJohn O'Reilly
08/22/2020, 9:59 AMRoute
extension function....something like
fun Route.apiRoute() {
route("/api") {
get("/interests") {
call.respondText("hello world")
}
}
}
then you'd have
routing {
apiRoute()
}
zero_coding
08/22/2020, 10:13 AMEric Grimsborn
08/24/2020, 12:00 PMtypealias RouteHandler = suspend PipelineContext<Unit, ApplicationCall>.(Unit) -> Unit
Handlers.kt
val helloWorld: RouteHandler = {
call.respondText("hello world")
}
Routes.kt
routing {
route("/api") {
get("/interests", helloWorld)
}
}