Crate axtra

Crate axtra 

Source
Expand description

§Axtra

Opinionated helpers for Axum + Astro projects.

§Features

  • AppError: Unified error type for Axum APIs.
  • Error Macros: Ergonomic error construction with app_error!.
  • TypeScript Type Generation: Rust error types exported via ts-rs.
  • Error Notifications: Sentry, Slack, Discord integration (optional).
  • Wrapped JSON Responses: WrappedJson<T> and ResponseKey derive macro.
  • Health Check Endpoint: Built-in Axum route for Postgres connectivity.
  • Static File Serving: SPA and static file helpers for Axum.
  • Bouncer (optional): Reject and ban IP’s hitting invalid endpoints.

§See Also

Modules§

errors
Error types, macros, and helpers for Axtra.
response
routes

Macros§

app_error
Error macro - handles all error types with optional format
error_location
Macro to get the current module and line location. Usage: error_location!("something went wrong: {}", detail)

Derive Macros§

ResponseKey