use actix_web::{get, HttpResponse, Responder}; use askama::Template; #[get("/")] pub async fn page() -> impl Responder { HttpResponse::Ok().body(get_index()) } #[derive(Template)] #[template(path = "../templates/index.html")] struct IndexTemplate<'a> { name: &'a str, } pub fn get_index() -> std::string::String { let index = IndexTemplate { name: "world" }; index.render().unwrap() }