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
This commit is contained in:
Emi Tatsuo 2020-12-13 19:53:18 -05:00
parent 3347c708af
commit 63c228bcfa
Signed by: Emi
GPG key ID: 68FAB2E2E6DFC98B
7 changed files with 14 additions and 10 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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; }