Skip to main content

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.

val appHandler = routes(
HealthCheck.json(),
// ...
)

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.

fun staticAssets(
developmentMode: Boolean,
classpathLocation: String = "webapp/static",
directory: String = "src/main/resources/webapp/static"
): RoutingHttpHandler