refactor: http-axum split into api/html/federation modules, router.rs, templates per page group
This commit is contained in:
14
crates/adapters/http-axum/src/html/render.rs
Normal file
14
crates/adapters/http-axum/src/html/render.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use axum::{
|
||||
http::StatusCode,
|
||||
response::{Html, IntoResponse, Response},
|
||||
};
|
||||
|
||||
pub fn render_page(template: impl askama::Template) -> Response {
|
||||
match template.render() {
|
||||
Ok(html) => Html(html).into_response(),
|
||||
Err(e) => {
|
||||
tracing::error!("template error: {e}");
|
||||
StatusCode::INTERNAL_SERVER_ERROR.into_response()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user