windmark-comments

Crates.iowindmark-comments
lib.rswindmark-comments
version0.1.3
sourcesrc
created_at2022-04-01 08:28:48.520316
updated_at2022-04-03 09:36:58.512882
descriptionA comment engine module for Windmark
homepagehttps://github.com/gemrest/windmark-comments
repositoryhttps://github.com/gemrest/windmark-comments
max_upload_size
id560169
size66,915
Fuwn (Fuwn)

documentation

https://docs.rs/windmark-comments

README

Windmark Comments

crates.io docs.rs github.com

A comment engine module for Windmark.

Usage

Add Windmark Comments as a dependency

# Cargo.toml

[dependencies]
windmark-comments = "0.1.3"

Attach Windmark Comments as a module (Windmark >= 0.1.8)

// 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)

// 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
}

Examples

Examples can be found within the examples directory.

License

This project is licensed with the GNU General Public License v3.0.

Commit count: 8

cargo fmt