Skip to main content

export_app

Macro export_app 

Source
export_app!() { /* proc-macro */ }
Expand description

Export a vespera app as a reusable component.

Generates a struct with:

  • OPENAPI_SPEC: &'static str - The OpenAPI JSON spec
  • router() -> Router - Function returning the Axum router

§Example

// Simple - uses "routes" folder by default
vespera::export_app!(MyApp);

// Custom directory
vespera::export_app!(MyApp, dir = "api");

// Generates:
// pub struct MyApp;
// impl MyApp {
//     pub const OPENAPI_SPEC: &'static str = "...";
//     pub fn router() -> axum::Router { ... }
// }