Added AppState.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
use axum::extract::FromRef;
|
||||
use sqlx::PgPool;
|
||||
|
||||
#[derive(Clone, FromRef)]
|
||||
pub struct AppState {
|
||||
pub pool: PgPool,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
pub fn new(pool: PgPool) -> Self {
|
||||
Self { pool }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user