aboutsummaryrefslogtreecommitdiff
path: root/rossweisse/README.md
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-04-27 06:04:36 +0000
committerFuwn <[email protected]>2023-04-27 06:04:36 +0000
commit26a2b91fca04ad48664a53d818c7337b41e285ea (patch)
tree9193322f0f1dc949a7f3886652c07bfe156b0949 /rossweisse/README.md
parentdocs(rossweisse): add fields for crates.io package (diff)
downloadwindmark-26a2b91fca04ad48664a53d818c7337b41e285ea.tar.xz
windmark-26a2b91fca04ad48664a53d818c7337b41e285ea.zip
docs(rossweisse): add a readme
Diffstat (limited to 'rossweisse/README.md')
-rw-r--r--rossweisse/README.md47
1 files changed, 47 insertions, 0 deletions
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).