Skip to main content

minifly_api/
lib.rs

1pub mod config;
2pub mod docker;
3pub mod error;
4pub mod handlers;
5pub mod health;
6pub mod middleware;
7pub mod state;
8
9use axum::Router;
10use tower_http::trace::TraceLayer;
11
12pub use state::AppState;
13pub use config::Config;
14
15/// Create the main application router
16pub fn create_app(state: AppState) -> Router {
17    Router::new()
18        .nest("/v1", handlers::routes())
19        .layer(axum::middleware::from_fn(middleware::region::region_middleware))
20        .layer(TraceLayer::new_for_http())
21        .with_state(state)
22}