aboutsummaryrefslogtreecommitdiff
path: root/examples/simple_tokio.rs
blob: 8da902ecc6a37c3c54f71d1cfc974ff6839c389a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
//! `cargo run --example simple_tokio --features tokio`

#[windmark::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  windmark::router::Router::new()
    .set_private_key_file("windmark_private.pem")
    .set_certificate_file("windmark_public.pem")
    .mount("/", |_| {
      windmark::response::Response::success("Hello, Tokio!")
    })
    .run()
    .await
}