li7y/src/frontend/mod.rs

24 lines
477 B
Rust
Raw Normal View History

2024-07-03 14:19:58 +02:00
// SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
mod item;
use actix_web::{get, web, HttpRequest, Responder};
use askama_actix::Template;
pub fn config(cfg: &mut web::ServiceConfig) {
cfg.service(index).configure(item::config);
}
#[derive(Template)]
#[template(path = "base.html")]
struct Home {
req: HttpRequest,
}
#[get("/")]
async fn index(req: HttpRequest) -> impl Responder {
Home { req }
}