Added AppState.

This commit is contained in:
2026-10-12 13:05:38 +02:00
parent 0b0c72b337
commit e963947bf8
12 changed files with 31 additions and 15 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
use axum::{http::StatusCode, routing::get};
use crate::error::AppError;
use crate::{error::AppError, state::AppState};
mod account_members;
mod accounts;
@@ -15,7 +15,7 @@ mod user_app_secrets;
mod user_apps;
mod users;
pub fn create_router(pool: sqlx::PgPool) -> axum::Router {
pub fn create_router(state: AppState) -> axum::Router {
let api = axum::Router::new()
.nest("/auth/passkey", auth_passkey::create_router())
.nest("/auth/token", auth_token::create_router())
@@ -40,5 +40,5 @@ pub fn create_router(pool: sqlx::PgPool) -> axum::Router {
.nest("/api", api)
.route("/health", get(async || StatusCode::NO_CONTENT))
.fallback(async || AppError::NotFound)
.with_state(pool)
.with_state(state)
}