li7y/src/frontend/mod.rs

27 lines
541 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;
2024-07-07 13:48:31 +02:00
mod item_class;
2024-07-03 14:19:58 +02:00
use actix_web::{get, web, HttpRequest, Responder};
use askama_actix::Template;
pub fn config(cfg: &mut web::ServiceConfig) {
2024-07-07 13:48:31 +02:00
cfg.service(index)
.configure(item::config)
.configure(item_class::config);
2024-07-03 14:19:58 +02:00
}
#[derive(Template)]
#[template(path = "base.html")]
struct Home {
req: HttpRequest,
}
#[get("/")]
async fn index(req: HttpRequest) -> impl Responder {
Home { req }
}