From 7a8ce1eca588e08b085f3bb413416d2ff315d90d Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 1 Apr 2022 01:08:02 -0700 Subject: feat: prep for 0.1.0 --- examples/windmark_comments.rs | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 examples/windmark_comments.rs (limited to 'examples/windmark_comments.rs') diff --git a/examples/windmark_comments.rs b/examples/windmark_comments.rs new file mode 100644 index 0000000..bfe6bed --- /dev/null +++ b/examples/windmark_comments.rs @@ -0,0 +1,48 @@ +// This file is part of Windmark Comments . +// Copyright (C) 2022-2022 Fuwn +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Copyright (C) 2022-2022 Fuwn +// SPDX-License-Identifier: GPL-3.0-only + +use windmark::Response; + +#[windmark::main] +async fn main() -> Result<(), Box> { + windmark::Router::new() + .set_private_key_file("windmark_comments_private.pem") + .set_certificate_file("windmark_comments_public.pem") + .attach(windmark_comments::module) + .mount( + "/", + Box::new(|_| { + Response::Success( + "# WINDMARK COMMENTS\nHello, World!\n=> /other To another route!" + .to_string(), + ) + }), + ) + .mount( + "/other", + Box::new(|_| { + Response::Success( + "# OTHER\nComments also show up on this route!\n=> / Back to the \ + main route!" + .to_string(), + ) + }), + ) + .run() + .await +} -- cgit v1.2.3