feat: add base app

This commit is contained in:
2025-01-11 22:45:44 +01:00
commit 11f8cccde4
30 changed files with 4317 additions and 0 deletions

14
crates/app/src/state.rs Normal file
View File

@@ -0,0 +1,14 @@
use axum::extract::FromRef;
use leptos::prelude::expect_context;
use server_fn::ServerFnError;
#[derive(FromRef, Clone)]
pub struct State {}
pub async fn get_state() -> Result<State, ServerFnError> {
let state = expect_context::<crate::state::State>();
let axum::extract::State(state): axum::extract::State<crate::state::State> =
leptos_axum::extract_with_state(&state).await?;
Ok(state)
}