···77Windmark is an elegant and highly performant, async Gemini server framework for
88the modern age!
991010+Now supporting both [Tokio](https://github.com/tokio-rs/tokio) and [`async-std`](https://github.com/async-rs/async-std)!
1111+1012## Usage
11131214Check out an example starter project
+29
examples/simple_async_std.rs
···11+// This file is part of Windmark <https://github.com/gemrest/windmark>.
22+// Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
33+//
44+// This program is free software: you can redistribute it and/or modify
55+// it under the terms of the GNU General Public License as published by
66+// the Free Software Foundation, version 3.
77+//
88+// This program is distributed in the hope that it will be useful, but
99+// WITHOUT ANY WARRANTY; without even the implied warranty of
1010+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1111+// General Public License for more details.
1212+//
1313+// You should have received a copy of the GNU General Public License
1414+// along with this program. If not, see <http://www.gnu.org/licenses/>.
1515+//
1616+// Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
1717+// SPDX-License-Identifier: GPL-3.0-only
1818+1919+//! `cargo run --example simple_async_std --features async-std`
2020+2121+#[windmark::main]
2222+async fn main() -> Result<(), Box<dyn std::error::Error>> {
2323+ windmark::Router::new()
2424+ .set_private_key_file("windmark_private.pem")
2525+ .set_certificate_file("windmark_public.pem")
2626+ .mount("/", |_| windmark::Response::success("Hello, async-std!"))
2727+ .run()
2828+ .await
2929+}
+29
examples/simple_tokio.rs
···11+// This file is part of Windmark <https://github.com/gemrest/windmark>.
22+// Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
33+//
44+// This program is free software: you can redistribute it and/or modify
55+// it under the terms of the GNU General Public License as published by
66+// the Free Software Foundation, version 3.
77+//
88+// This program is distributed in the hope that it will be useful, but
99+// WITHOUT ANY WARRANTY; without even the implied warranty of
1010+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1111+// General Public License for more details.
1212+//
1313+// You should have received a copy of the GNU General Public License
1414+// along with this program. If not, see <http://www.gnu.org/licenses/>.
1515+//
1616+// Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
1717+// SPDX-License-Identifier: GPL-3.0-only
1818+1919+//! `cargo run --example simple_tokio --features tokio`
2020+2121+#[windmark::main]
2222+async fn main() -> Result<(), Box<dyn std::error::Error>> {
2323+ windmark::Router::new()
2424+ .set_private_key_file("windmark_private.pem")
2525+ .set_certificate_file("windmark_public.pem")
2626+ .mount("/", |_| windmark::Response::success("Hello, Tokio!"))
2727+ .run()
2828+ .await
2929+}
+3
src/lib.rs
···4040#[macro_use]
4141extern crate log;
42424343+#[cfg(feature = "async-std")]
4444+pub use async_std::main;
4345pub use module::{AsyncModule, Module};
4446pub use response::Response;
4547pub use router::Router;
4848+#[cfg(feature = "tokio")]
4649pub use tokio::main;