Blueprints

A blueprint is a group of routes that share a URL prefix, a template base, or a static directory. They're handy for splitting a large app into modules — for example one blueprint per API version.

Creating a blueprint

crow::Blueprint api("api/v1", "static_v1", "templates_v1");

CROW_BP_ROUTE(api, "/users")([] {
    return "v1 users";
});

Mounting on the app

app.register_blueprint(api);

The blueprint's prefix is prepended to every route inside it, so the handler above answers GET /api/v1/users.