24 lines
477 B
Rust
24 lines
477 B
Rust
|
// 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 }
|
||
|
}
|