index : gitrs
A lightweight web interface for browsing Git repositories, implemented in Rust
about summary refs log tree commit diff
gitrs / src / routes / about.rs
-rw-r--r-- blob 3b1be1223968c0a2cce063ca53c853c2782cfad5 390 bytes (plain)
1
use crate::prelude::*;
2
3
#[derive(Template)]
4
#[template(path = "about.html")]
5
struct About {}
6
7
#[get("/about")]
8
pub async fn page() -> ActixResult<HttpResponse> {
9
    let rendered = About {}.render();
10
11
    match rendered {
12
        Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
13
        Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
14
    }
15
}