summaryrefslogtreecommitdiffstats
path: root/src/public.rs
diff options
context:
space:
mode:
authorJokler <jokler@protonmail.com>2020-06-23 16:26:07 +0200
committerJokler <jokler@protonmail.com>2020-06-23 16:26:07 +0200
commitfc7bd403bf41d724bd8dc3bf3b827c592c539171 (patch)
tree1b816f68f1793dc8bf70e490196da6ae58d6f16a /src/public.rs
downloadrgit-fc7bd403bf41d724bd8dc3bf3b827c592c539171.tar.gz
rgit-fc7bd403bf41d724bd8dc3bf3b827c592c539171.zip
Initial commitHEADmaster
Diffstat (limited to 'src/public.rs')
-rw-r--r--src/public.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/public.rs b/src/public.rs
new file mode 100644
index 0000000..6a5f8c8
--- /dev/null
+++ b/src/public.rs
@@ -0,0 +1,14 @@
+use actix_web::{HttpResponse, Responder};
+use askama::Template;
+
+#[derive(Template)]
+#[template(path = "index.htm")]
+struct IndexTemplate<'a> {
+ text: &'a str,
+}
+
+pub async fn index() -> impl Responder {
+ HttpResponse::Ok()
+ .content_type("text/html")
+ .body(IndexTemplate { text: "Hello" }.render().unwrap())
+}