aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-04-01 19:29:02 -0700
committerFuwn <[email protected]>2022-04-01 19:29:02 -0700
commitf37008221bc362f5742223dd8fe06a27d88f6aa9 (patch)
tree4a01b7f130059e8cfcf7358c272bafda24fb1d61 /README.md
parentdocs(rust): add crate docs (diff)
downloadwindmark-comments-f37008221bc362f5742223dd8fe06a27d88f6aa9.tar.xz
windmark-comments-f37008221bc362f5742223dd8fe06a27d88f6aa9.zip
feat: support windmark 0.1.80.1.2
Diffstat (limited to 'README.md')
-rw-r--r--README.md27
1 files changed, 25 insertions, 2 deletions
diff --git a/README.md b/README.md
index 5c5a983..e1e1dff 100644
--- a/README.md
+++ b/README.md
@@ -14,10 +14,33 @@ A comment engine module for Windmark.
# Cargo.toml
[dependencies]
-windmark-comments = "0.1.1"
+windmark-comments = "0.1.2"
```
-### Attach Windmark Comments as a module
+### Attach Windmark Comments as a module (Windmark >= 0.1.8)
+
+```rust
+// src/main.rs
+
+use windmark::Response;
+
+#[windmark::main]
+fn main() -> Result<(), Box<dyn std::error::Error>> {
+ windmark::Router::new()
+ .set_private_key_file("windmark_comments_private.pem")
+ .set_certificate_file("windmark_comments_public.pem")
+ .mount("/", Box::new(|_| Response::Success("Hello, World!".into())))
+ .set_error_handler(Box::new(|_| {
+ Response::PermanentFailure("This route does not exist!".into())
+ }))
+ // Attach Windmark Comments
+ .attach_stateless(windmark_comments::module)
+ .run()
+ .await
+}
+```
+
+### Attach Windmark Comments as a module (Windmark <= 0.1.7)
```rust
// src/main.rs