blob: 0d963605d24c049da493cfdf7975136947fa5ec6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# Windmark
[](https://crates.io/crates/windmark)
[](https://docs.rs/windmark)
[](https://github.com/gemrest/windmark/actions/workflows/check.yaml)
Windmark is An elegant and highly performant async Gemini server framework.
## Usage
### Add Windmark as a dependency
```toml
# Cargo.toml
[dependencies]
windmark = "0.1.1"
# If you would like to use the built-in logger (reccomended)
# windmark = { version = "0.1.1", features = ["logger"] }
```
### Implement a Windmark server
```rust
use windmark::Response;
#[windmark::main]
fn main() -> Result<(), Box<dyn std::error::Error>> {
windmark::Router::new()
.mount("/", |_| Response::Success("Hello, World!".into()))
.set_error_handler(|_| {
Response::PermanentFailure("This route does not exist!".into())
})
.run()
.await
}
```
## Examples
Examples can be found within the [`examples/`](./examples) directory.
## License
This project is licensed with the [GNU General Public License v3.0](./LICENSE).
|