Something went wrong. Try again.
🏗️ Elegant & Highly Performant Async Gemini Server Framework for the Modern Age
async framework gemini-protocol protocol gemini rust
Something went wrong. Try again.
123456789101112131415161718192021222324252627//! `cargo run --example input`
use windmark::{context::RouteContext, response::Response};
#[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("/input", |context: RouteContext| { if let Some(name) = context.url.query() { Response::success(format!("Your name is {}!", name)) } else { Response::input("What is your name?") } }) .mount("/sensitive", |context: RouteContext| { if let Some(password) = context.url.query() { Response::success(format!("Your password is {}!", password)) } else { Response::sensitive_input("What is your password?") } }) .run() .await}