Some more cleanup.

This commit is contained in:
2026-09-27 10:02:30 +02:00
parent 67153c79bb
commit 5f4c9bdf90
5 changed files with 27 additions and 31 deletions
+12 -14
View File
@@ -1,3 +1,5 @@
use axum::{http::StatusCode, routing::get};
use crate::error::AppError;
pub mod dtos;
@@ -6,20 +8,16 @@ pub mod scheduled_transactions;
pub mod transactions;
pub fn create_router(pool: sqlx::PgPool) -> axum::Router {
let scheduled_transactions = scheduled_transactions::create_router();
let transactions = transactions::create_router();
let api = axum::Router::new()
.nest("/scheduled-transactions", scheduled_transactions)
.nest("/transactions", transactions);
axum::Router::new()
.nest(
"/api",
axum::Router::new()
.nest(
"/scheduled-transactions",
scheduled_transactions::create_router(),
)
.nest("/transactions", transactions::create_router()),
)
.fallback(handle_fallback)
.nest("/api", api)
.route("/health", get(async || StatusCode::NO_CONTENT))
.fallback(async || AppError::NotFound)
.with_state(pool)
}
async fn handle_fallback() -> AppError {
AppError::NotFound
}