diff options
| -rw-r--r-- | README.md | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -8,6 +8,8 @@ Windmark is a simple and highly performant Gemini server framework. ## Usage +### Add Windmark as a dependency + ```toml # Cargo.toml @@ -18,6 +20,21 @@ windmark = "0.1.0" # windmark = { version = "0.1.0", features = ["logger"] } ``` +### Implement a Windmark server + +```rust +use windmark::response::Response; + +fn main() -> std::io::Result<()> { + windmark::Router::new() + .mount("/", |_, _, _| Response::Success("Hello, World!".into())) + .set_error_handler(|_, _, _| { + Response::PermanentFailure("This route does not exist!".into()) + }) + .run() +} +``` + ## Examples Examples can be found within the [`examples/`](./examples) directory. |