From 63c228bcfa2ea586579cb9c1e00bd146fed93bb6 Mon Sep 17 00:00:00 2001 From: Emi Tatsuo Date: Sun, 13 Dec 2020 19:53:18 -0500 Subject: [PATCH] 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 --- examples/certificates.rs | 2 +- examples/document.rs | 2 +- examples/ratelimiting.rs | 2 +- examples/routing.rs | 2 +- examples/serve_dir.rs | 2 +- examples/user_management.rs | 2 +- src/lib.rs | 12 ++++++++---- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/examples/certificates.rs b/examples/certificates.rs index cce548b..5076f4c 100644 --- a/examples/certificates.rs +++ b/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 } diff --git a/examples/document.rs b/examples/document.rs index 032a03b..bbfb23a 100644 --- a/examples/document.rs +++ b/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 } diff --git a/examples/ratelimiting.rs b/examples/ratelimiting.rs index f8021cb..20eb5a2 100644 --- a/examples/ratelimiting.rs +++ b/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 } diff --git a/examples/routing.rs b/examples/routing.rs index 2586c58..fbd2b92 100644 --- a/examples/routing.rs +++ b/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 } diff --git a/examples/serve_dir.rs b/examples/serve_dir.rs index fdbc846..732dae9 100644 --- a/examples/serve_dir.rs +++ b/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 } diff --git a/examples/user_management.rs b/examples/user_management.rs index d0e945d..053e741 100644 --- a/examples/user_management.rs +++ b/examples/user_management.rs @@ -35,7 +35,7 @@ async fn main() -> Result<()> { .add_um_routes::() // Start the server - .serve_unix("kochab.sock") + .serve_unix("localhost:1965") .await } diff --git a/src/lib.rs b/src/lib.rs index b928b87..05b8e6c 100644 --- a/src/lib.rs +++ b/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:" //!