blob: 5eaff878e3455df246fdf9231627ea7b9d9eb110 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
//! `cargo run --example stateless_module`
use windmark::{response::Response, router::Router};
fn smiley(_context: windmark::context::RouteContext) -> Response {
Response::success("😀")
}
fn emojis(router: &mut Router) { router.mount("/smiley", smiley); }
#[windmark::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
Router::new()
.set_private_key_file("windmark_private.pem")
.set_certificate_file("windmark_public.pem")
.attach_stateless(emojis)
.run()
.await
}
|