migrate axum and askama
test / cargo test (push) Failing after 1m10s

This commit is contained in:
2025-06-16 21:15:53 +02:00
parent 5ba193cd56
commit 6a5a9c890f
19 changed files with 194 additions and 112 deletions
+10 -2
View File
@@ -1,9 +1,17 @@
use askama::Template;
use axum::{
http::StatusCode,
response::{Html, IntoResponse},
};
#[derive(Template)]
#[template(path = "admin.html")]
pub struct AdminPageTemplate {}
pub async fn render_admin() -> AdminPageTemplate {
AdminPageTemplate {}
pub async fn render_admin() -> Result<impl IntoResponse, StatusCode> {
Ok(Html(
AdminPageTemplate {}
.render()
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR),
))
}