diff options
| author | Fuwn <[email protected]> | 2023-04-27 06:04:36 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-04-27 06:04:36 +0000 |
| commit | 26a2b91fca04ad48664a53d818c7337b41e285ea (patch) | |
| tree | 9193322f0f1dc949a7f3886652c07bfe156b0949 /rossweisse | |
| parent | docs(rossweisse): add fields for crates.io package (diff) | |
| download | windmark-26a2b91fca04ad48664a53d818c7337b41e285ea.tar.xz windmark-26a2b91fca04ad48664a53d818c7337b41e285ea.zip | |
docs(rossweisse): add a readme
Diffstat (limited to 'rossweisse')
| -rw-r--r-- | rossweisse/Cargo.toml | 1 | ||||
| -rw-r--r-- | rossweisse/README.md | 47 |
2 files changed, 48 insertions, 0 deletions
diff --git a/rossweisse/Cargo.toml b/rossweisse/Cargo.toml index dd86d13..20cca61 100644 --- a/rossweisse/Cargo.toml +++ b/rossweisse/Cargo.toml @@ -7,6 +7,7 @@ authors = ["Fuwn <[email protected]>"] edition = "2021" description = "`struct`-based Router Framework for Windmark" documentation = "https://docs.rs/rossweisse" +readme = "README.md" repository = "https://github.com/gemrest/windmark" license = "GPL-3.0-only" keywords = ["gemini", "windmark"] diff --git a/rossweisse/README.md b/rossweisse/README.md new file mode 100644 index 0000000..be7a4b5 --- /dev/null +++ b/rossweisse/README.md @@ -0,0 +1,47 @@ +# Rossweisse + +`struct`-based Router Framework for [Windmark](https://github.com/gemrest/windmark) + +## Usage + +Rossweisse is in it's infancy, and a much comprehensive interface is planned. + +For now, a simple Rosswiesse router can be implemented like this: + +```rust +use rossweisse::route; + +#[rossweisse::router] +struct Router { + _phantom: (), +} + +#[rossweisse::router] +impl Router { + #[route] + pub fn index( + _context: windmark::context::RouteContext, + ) -> windmark::Response { + windmark::Response::success("Hello, World!") + } +} + +#[windmark::main] +async fn main() -> Result<(), Box<dyn std::error::Error>> { + { + let mut router = Router::new(); + + router.router().set_private_key_file("windmark_private.pem"); + router.router().set_certificate_file("windmark_public.pem"); + + router + } + .run() + .await +} +``` + +## License + +This project is licensed with the +[GNU General Public License v3.0](https://github.com/gemrest/windmark/blob/main/LICENSE). |