hyukchan
04/25/2019, 4:20 PMKevin Schmeichel
04/25/2019, 5:14 PMluke
04/25/2019, 5:15 PMhdarritchon
04/26/2019, 8:44 AMinstall(Routing) {
val konfig = HoconKonfigAdapter()
val contextPath = konfig.get("ktor.deployment.context-path")
route("$contextPath/api/v1") {
val registry = feature(Metrics).registry
healthEndPoints()
metricsEndPoints(registry)
routeWithMeasureTime {
catalogSiEndPoints()
reunionCatalogEditoEndPoints()
telesurveillanceCatalogEditoEndPoints()
catalogLegacyEndPoints()
}
}
}
And the extension function looks like, each extension function in a separate kt file :
@KtorExperimentalLocationsAPI
fun Route.healthEndPoints() {
get<HealthEndpoint> {
call.respond(Health(HealthCheck.systemIs.state))
}
}
Quite easy and simple.Kevin Schmeichel
04/26/2019, 5:40 PMNo type arguments expected for fun Route.get(...)