aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: cb18c2255cda9fb4e998d1cfdc5aaf483acbf93a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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())
}