Handlers
Ready-to-use routing handlers for common needs.
HealthCheck.json
A /health route returning a JSON {"status":"healthy"} body. Intended for load balancer and
container orchestrator health probes.
- Example
- Declaration
val appHandler = routes(
HealthCheck.json(),
// ...
)
object HealthCheck {
fun json(): RoutingHttpHandler
}
staticAssets
A routing handler that serves static assets either from the filesystem (when developmentMode = true)
or from the classpath. See Static assets for the full setup.
- Declaration
fun staticAssets(
developmentMode: Boolean,
classpathLocation: String = "webapp/static",
directory: String = "src/main/resources/webapp/static"
): RoutingHttpHandler