[][src]Crate rocket_healthz

The rocket_healthz crate provides a macro to easily add a /healthz endpoint to your Rocket project. The endpoint responds with HTTP 200 and the plain text OK. You can use it for health checks when you want to verify that the server is running.

#[macro_use] extern crate rocket;
rocket_healthz::healthz!();

#[launch]
fn rocket() -> rocket::Rocket {
    rocket::ignite().mount("/", routes![rocket_healthz])
}

The macro defines the route, but it still needs to be mounted manually for now.

The macro also defines an integration test so the /healthz route will be automatically tested. This currently requires the existence of a function named rocket() that returns rocket::Rocket.

Macros

healthz