windmark 0.1.8

An elegant and highly performant async Gemini server framework
Documentation

Windmark

crates.io docs.rs github.com

Windmark is an elegant and highly performant, async Gemini server framework.

Usage

Add Windmark as a dependency

# Cargo.toml



[dependencies]

windmark = "0.1.8"

tokio = { version = "0.2.4", features = ["full"] }



# If you would like to use the built-in logger (recommended)

# windmark = { version = "0.1.8", features = ["logger"] }



# If you would like to use the built-in MIME dedection when `Success`-ing a file

# (recommended)

# windmark = { version = "0.1.8", features = ["auto-deduce-mime"] }

Implement a Windmark server

// src/main.rs

use windmark::Response;

#[windmark::main]
fn main() -> Result<(), Box<dyn std::error::Error>> {
  windmark::Router::new()
    .set_private_key_file("windmark_private.pem")
    .set_certificate_chain_file("windmark_public.pem")
    .mount("/", Box::new(|_| Response::Success("Hello, World!".into())))
    .set_error_handler(Box::new(|_| {
      Response::PermanentFailure("This route does not exist!".into())
    }))
    .run()
    .await
}

Examples

Examples can be found within the examples/ directory.

Modules

Modules are reusable extensions which can be procedurally mounted onto Windmark routers.

Add yours!

Capsules using Windmark

Add yours!

License

This project is licensed with the GNU General Public License v3.0.