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

#[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, async-std!")
    })
    .run()
    .await
}