@@ -4,6 +4,7 @@ import arrow.continuations.SuspendApp
44import arrow.continuations.ktor.server
55import arrow.fx.coroutines.resourceScope
66import com.sksamuel.cohort.Cohort
7+ import com.sksamuel.cohort.HealthCheckRegistry
78import io.github.nomisrev.articles.articleRoutes
89import io.github.nomisrev.articles.commentRoutes
910import io.github.nomisrev.env.Dependencies
@@ -17,6 +18,7 @@ import io.ktor.server.application.*
1718import io.ktor.server.netty.Netty
1819import io.ktor.server.routing.routing
1920import kotlinx.coroutines.*
21+ import kotlinx.coroutines.Dispatchers
2022
2123fun main () = SuspendApp {
2224 val env = Env ()
@@ -36,5 +38,10 @@ fun Application.app(module: Dependencies) {
3638 commentRoutes(module.userService, module.articleService, module.jwtService)
3739 profileRoutes(module.userPersistence, module.jwtService)
3840 }
39- install(Cohort ) { healthcheck(" /readiness" , module.healthCheck) }
41+ install(Cohort ) {
42+ verboseHealthCheckResponse = developmentMode
43+ healthcheck(" /healthz/startup" , HealthCheckRegistry (Dispatchers .Default ))
44+ healthcheck(" /healthz/liveness" , HealthCheckRegistry (Dispatchers .Default ))
45+ healthcheck(" /healthz/readiness" , module.healthCheck)
46+ }
4047}
0 commit comments