tailwind and static files init

This commit is contained in:
Per Stark
2024-12-04 17:20:57 +01:00
parent 58ddc1f824
commit f9a382db6d
10 changed files with 632 additions and 3 deletions

View File

@@ -1,10 +1,16 @@
use axum::{response::Html, Extension};
use serde_json::json;
use tera::{Context, Tera};
use crate::error::ApiError;
pub async fn index_handler(Extension(tera): Extension<Tera>) -> Result<Html<String>, ApiError> {
let output = tera.render("index.html", &Context::new()).unwrap();
let output = tera
.render(
"index.html",
&Context::from_value(json!({"adjective": "CRAYCRAY"})).unwrap(),
)
.unwrap();
Ok(output.into())
}