You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
406 B
19 lines
406 B
use actix_web::web;
|
|
use actix_web::{Responder, get};
|
|
|
|
use askama_actix::Template;
|
|
use askama_actix::TemplateToResponse;
|
|
|
|
use crate::commons::AppData;
|
|
|
|
#[derive(Template)]
|
|
#[template(path = "index.html")]
|
|
pub struct PageTemplate {
|
|
pub name: String,
|
|
}
|
|
|
|
#[get("/")]
|
|
async fn index(data: web::Data<AppData>) -> impl Responder {
|
|
let name = data.name.to_owned();
|
|
PageTemplate { name }.to_response()
|
|
} |