aboutsummaryrefslogtreecommitdiff
path: root/examples/partial.rs
blob: 3bf60b02265caffa0137a7228dedf529a1576c6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `cargo run --example partial`

#[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")
    .add_header(|_| "This is fancy art.\n".to_string())
    .add_footer(|context: windmark::context::RouteContext| {
      format!("\nYou came from '{}'.", context.url.path())
    })
    .add_footer(|_| "\nCopyright (C) 2022".to_string())
    .mount("/", windmark::success!("Hello!"))
    .run()
    .await
}