Browse Source

Replace molly brown w/ stargazer, serve examples in IP

Stargazer is available thru cargo, which makes it more accessable to new users.  Serving ip allows examples to be run in gemini_srv mode
devel
Emi Tatsuo 2 years ago
parent
commit
63c228bcfa
Signed by: Emi
GPG Key ID: 68FAB2E2E6DFC98B
  1. 2
      examples/certificates.rs
  2. 2
      examples/document.rs
  3. 2
      examples/ratelimiting.rs
  4. 2
      examples/routing.rs
  5. 2
      examples/serve_dir.rs
  6. 2
      examples/user_management.rs
  7. 12
      src/lib.rs

2
examples/certificates.rs

@ -13,7 +13,7 @@ async fn main() -> Result<()> {
Server::new()
.add_route("/", handle_request)
.serve_unix("kochab.sock")
.serve_ip("localhost:1965")
.await
}

2
examples/document.rs

@ -40,6 +40,6 @@ async fn main() -> Result<()> {
Server::new()
.add_route("/", response)
.serve_unix("kochab.sock")
.serve_ip("localhost:1965")
.await
}

2
examples/ratelimiting.rs

@ -13,7 +13,7 @@ async fn main() -> Result<()> {
Server::new()
.add_route("/", handle_request)
.ratelimit("/limit", 2, Duration::from_secs(60))
.serve_unix("kochab.sock")
.serve_ip("localhost:1965")
.await
}

2
examples/routing.rs

@ -12,7 +12,7 @@ async fn main() -> Result<()> {
.add_route("/", handle_base)
.add_route("/route", handle_short)
.add_route("/route/long", handle_long)
.serve_unix("kochab.sock")
.serve_ip("localhost:1965")
.await
}

2
examples/serve_dir.rs

@ -13,6 +13,6 @@ async fn main() -> Result<()> {
Server::new()
.add_route("/", PathBuf::from("public")) // Serve directory listings & file contents
.add_route("/about", PathBuf::from("README.md")) // Serve a single file
.serve_unix("kochab.sock")
.serve_ip("localhost:1965")
.await
}

2
examples/user_management.rs

@ -35,7 +35,7 @@ async fn main() -> Result<()> {
.add_um_routes::<String>()
// Start the server
.serve_unix("kochab.sock")
.serve_unix("localhost:1965")
.await
}

12
src/lib.rs

@ -137,15 +137,19 @@
//! To give your code a run, you'll need a server to handle Gemini requests and pass them
//! off to your SCGI server. There's a few Gemini servers out there with SCGI support,
//! but if you're just interested in giving your code a quick run, I'd recommend
//! mollybrown, which has very good SCGI support and is super easy to set up
//! stargazer, which has very good SCGI support and is super easy to set up if you are
//! already using cargo.
//!
//! You can grab a copy of molly brown from [tildegit.org/solderpunk/molly-brown][1].
//! You can install stargazer by running.
//! ```sh
//! cargo install stargazer
//! ```
//!
//! Once you have it, you can find a super simple configuration file [here][2], and then
//! just run
//!
//! ```sh
//! molly-brown -c molly-brown.conf
//! stargazer -C stargazer.ini
//! ```
//!
//! Now, when you run your code, you can connect to `localhost`, and molly brown will
@ -173,7 +177,7 @@
//! For more information, see [`Server::set_autorewrite()`].
//!
//! [1]: https://tildegit.org/solderpunk/molly-brown
//! [2]: https://gitlab.com/Alch_Emi/kochab/-/raw/244fd251/molly-brown.conf
//! [2]: https://gitlab.com/Alch_Emi/kochab/-/raw/devel/stargazer.ini
//! [blobcat-pout]: https://the-apothecary.club/_matrix/media/r0/thumbnail/the-apothecary.club/10a406405a5bcd699a5328259133bfd9260320a6?height=99&width=20 ":blobcat-pout:"
//! <style>
//! img[alt=blobcat-pout] { width: 20px; vertical-align: top; }

Loading…
Cancel
Save