aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index e7a11a9..cb18c22 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,18 @@
-fn main() {
- println!("Hello, world!");
+use askama::Template;
+use tide::prelude::*;
+
+#[derive(Template)]
+#[template(path = "index.html")]
+struct IndexTemplate;
+
+#[async_std::main]
+async fn main() -> tide::Result<()> {
+ let mut app = tide::new();
+ app.at("/").get(index);
+ app.listen("127.0.0.1:8000").await?;
+ Ok(())
+}
+
+async fn index(_: tide::Request<()>) -> tide::Result {
+ Ok(IndexTemplate.into())
}