Added AppState.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user