🏗️ Elegant & Highly Performant Async Gemini Server Framework for the Modern Age
async framework gemini-protocol protocol gemini rust
at main 33 lines 788 B view raw
1//! `cargo run --example parameters --features response-macros` 2 3use windmark::success; 4 5#[windmark::main] 6async fn main() -> Result<(), Box<dyn std::error::Error>> { 7 windmark::router::Router::new() 8 .set_private_key_file("windmark_private.pem") 9 .set_certificate_file("windmark_public.pem") 10 .mount( 11 "/language/:language", 12 success!( 13 context, 14 format!( 15 "Your language of choice is {}.", 16 context.parameters.get("language").unwrap() 17 ) 18 ), 19 ) 20 .mount( 21 "/name/:first/:last", 22 success!( 23 context, 24 format!( 25 "Your name is {} {}.", 26 context.parameters.get("first").unwrap(), 27 context.parameters.get("last").unwrap() 28 ) 29 ), 30 ) 31 .run() 32 .await 33}