Keep the REST contract; move domain logic out of route files so checkout, fulfillment, and identity can be reused across customer, shop, and admin surfaces. Co-authored-by: Cursor <cursoragent@cursor.com>
24 lines
539 B
Rust
24 lines
539 B
Rust
pub mod auth;
|
|
pub mod config;
|
|
pub mod error;
|
|
pub mod http;
|
|
pub mod models;
|
|
pub mod money;
|
|
pub mod modules;
|
|
pub mod seed;
|
|
pub mod state;
|
|
|
|
use axum::{routing::get, Router};
|
|
use tower_http::{cors::CorsLayer, trace::TraceLayer};
|
|
|
|
use crate::state::AppState;
|
|
|
|
pub fn build_router(state: AppState) -> Router {
|
|
Router::new()
|
|
.route("/api/health", get(modules::health::health))
|
|
.nest("/api", modules::api_router())
|
|
.layer(TraceLayer::new_for_http())
|
|
.layer(CorsLayer::permissive())
|
|
.with_state(state)
|
|
}
|