aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml4
-rw-r--r--README.md27
-rw-r--r--src/lib.rs47
3 files changed, 62 insertions, 16 deletions
diff --git a/Cargo.toml b/Cargo.toml
index a4535a7..34b5347 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,7 @@
[package]
name = "windmark-comments"
-version = "0.1.1"
+version = "0.1.2"
authors = ["Fuwn <[email protected]>"]
edition = "2021"
description = "A comment engine module for Windmark"
@@ -16,7 +16,7 @@ categories = ["web-programming"]
[dependencies]
# Windmark
-windmark = "0.1.7"
+windmark = "0.1.8"
# Date/ time
chrono = "0.4.19"
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
diff --git a/src/lib.rs b/src/lib.rs
index 8e3472d..9623f4f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -32,10 +32,10 @@
//! # 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
@@ -45,16 +45,39 @@
//! #[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(windmark_comments::module)
-//! .run()
-//! .await
+//! .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
+//!
+//! 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(windmark_comments::module)
+//! .run()
+//! .await
//! }
//! ```
//!