🏗️ Elegant & Highly Performant Async Gemini Server Framework for the Modern Age
async
framework
gemini-protocol
protocol
gemini
rust
1//! `cargo run --example struct_router`
2
3use rossweisse::route;
4use windmark::response::Response;
5
6#[rossweisse::router]
7struct Router;
8
9#[rossweisse::router]
10impl Router {
11 #[route(index)]
12 pub fn index(_context: windmark::context::RouteContext) -> Response {
13 Response::success("Hello, World!")
14 }
15}
16
17#[windmark::main]
18async fn main() -> Result<(), Box<dyn std::error::Error>> {
19 {
20 let mut router = Router::new();
21
22 router.router().set_private_key_file("windmark_private.pem");
23 router.router().set_certificate_file("windmark_public.pem");
24
25 router
26 }
27 .run()
28 .await
29}