summaryrefslogtreecommitdiff
path: root/src/index.rs
blob: 6411ff44bcd032e87a328a65668991e2dc221a05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use axum::{response::IntoResponse, routing::get, Router};

pub fn router<S>() -> Router<S>
where
    S: Send + Sync + Clone + 'static,
{
    Router::new().route("/", get(index))
}

async fn index() -> impl IntoResponse {
    templates::index()
}

mod templates {
    use maud::{html, Markup, DOCTYPE};
    pub fn index() -> Markup {
        html! {
            (DOCTYPE)
            head {
                title { "hi" }
            }
            body {
                form action="/login" method="post" {
                    label {
                        "name"
                        input name="name" type="text" {}
                    }
                    label {
                        "password"
                        input name="password" type="password" {}
                    }
                    button { "hi" }
                }
            }
        }
    }
}