index : gitrs
A lightweight web interface for browsing Git repositories, implemented in Rust
about summary refs log tree commit diff

Diffstat (limited to 'src/routes/about.rs')

-rw-r--r-- src/routes/about.rs 15
 1 file changed, 15 insertions(+)

diff --git a/src/routes/about.rs b/src/routes/about.rs
new file mode 100644
index 0000000..3b1be12 100644
--- /dev/null
+++ b/src/routes/about.rs
@@ -1,0 +1,15 @@
use crate::prelude::*;

#[derive(Template)]
#[template(path = "about.html")]
struct About {}

#[get("/about")]
pub async fn page() -> ActixResult<HttpResponse> {
    let rendered = About {}.render();

    match rendered {
        Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
        Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
    }
}