mylloon.fr/src/routes/index.rs
2023-02-09 10:45:59 +01:00

17 lines
366 B
Rust

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 {}
pub fn get_index() -> std::string::String {
let index = IndexTemplate {};
index.render().unwrap()
}