| Crates.io | spring-axum |
| lib.rs | spring-axum |
| version | 0.1.3 |
| created_at | 2025-10-13 15:35:31.474651+00 |
| updated_at | 2025-10-17 15:53:16.875992+00 |
| description | Spring-like application framework for Axum with macro-based auto discovery, validation, transactions, caching, events, and SQL/Mapper integrations. |
| homepage | https://gitee.com/luzhihaoTestingLab/spring-axum |
| repository | https://gitee.com/luzhihaoTestingLab/spring-axum.git |
| max_upload_size | |
| id | 1880680 |
| size | 139,212 |
Spring-like application framework for Axum. It provides macro-driven auto discovery (controllers, components, interceptors, advices), validation, transactions, caching, events, and SQL/Mapper integrations to help you build maintainable web apps quickly.
Repository: https://gitee.com/luzhihaoTestingLab/spring-axum.git
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let app = spring_axum::auto_discover!();
app.run().await
}
Or with explicit builder chain:
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let app = spring_axum::SpringApp::new()
.with_discovered_controllers()
.with_discovered_interceptors()
.with_discovered_advices()
.with_discovered_components();
app.run().await
}
#[controller] and route macros (#[route_get], #[route_post], #[route_put], #[route_delete])#[component] for DI-style component auto registration#[interceptor] for request/response interception#[transactional] and #[tx_service] for transaction wrappers (enable sqlx_postgres)#[cacheable], #[cache_put], #[cache_evict] for in-memory cachingevent_listener macro#[sql] / #[mapper]Enable features in Cargo.toml as needed:
[dependencies]
spring-axum = { version = "0.1", features = ["validator", "swagger", "sqlx_postgres"] }
MIT