blob: c2bd68958f28a6b4c427d44f0f6790d599ca14cd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
//! `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(|_: &windmark::context::RouteContext| {
"This is fancy art.\n".to_string()
})
.add_footer(|context: &windmark::context::RouteContext| {
format!("\nYou came from '{}'.", context.url.path())
})
.add_footer(|_: &windmark::context::RouteContext| {
"\nCopyright (C) 2022".to_string()
})
.mount("/", windmark::success!("Hello!"))
.run()
.await
}
|