Skip to content

Blueprint

The core of a Pavex project is its Blueprint.
It's the type you'll use to define your API: routes, middlewares, error handlers, etc.

You can find the Blueprint for the demo project in the app/src/blueprint.rs file:

app/src/blueprint.rs
// [...]
pub fn blueprint() -> Blueprint {
    let mut bp = Blueprint::new();
    ApiKit::new().register(&mut bp);
    telemetry::register(&mut bp);
    configuration::register(&mut bp);

    routes::register(&mut bp);
    bp
}