add: postgres support
chore: restructure
This commit is contained in:
parent
cda879f6df
commit
b6fe2fba37
58 changed files with 3403 additions and 603 deletions
15
crates/app/src/routes/pages/misc.rs
Normal file
15
crates/app/src/routes/pages/misc.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
use crate::{State, assets::initial_context, get_user_from_token};
|
||||
use axum::{
|
||||
Extension,
|
||||
response::{Html, IntoResponse},
|
||||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
|
||||
/// `/`
|
||||
pub async fn index_request(jar: CookieJar, Extension(data): Extension<State>) -> impl IntoResponse {
|
||||
let data = data.read().await;
|
||||
let user = get_user_from_token!((jar, data.0) <optional>);
|
||||
|
||||
let mut context = initial_context(&data.0.0, &user);
|
||||
Html(data.1.render("misc/index.html", &mut context).unwrap())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue