💾 Archived View for rawtext.club › ~sloum › geminilist › 004868.gmi captured on 2023-11-14 at 10:29:17. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

<-- back to the mailing list

[users] Simple Gemini server for testing in the current directory?

Gary Johnson lambdatronic at disroot.org

Wed Jan 20 20:13:54 GMT 2021

- - - - - - - - - - - - - - - - - - - 

mailinglists at ngalt.com writes:

One thing that I like about HTTP is that there are oodles of ways to spin up a simple server for testing on localhost. Things like `python3 -m http.server` and `caddy run` are what I'm thinking of. Since this is Gemini and not bare-bones HTTP, It'd have to handle key generation.
Is there a server like that yet for Gemini that runs on macOS?

If you are a Lispnik, feel free to check out Space Age (The Clojurian'sGemini Server):

https://gitlab.com/lambdatronic/space-age

Since Clojure compiles to Java bytecode, it's fully cross-platform. Youjust need to install a recent JDK and the Clojure command line tool. Keygeneration is handled with a single command, which is documented in theproject's README.

You can then launch Space Age with the following command:

$ clojure -M:run-server .

That will serve up the current directory and anything within it on port1965. To serve up a different directory, just replace "." with thedirectory path.

Uniquely among Gemini servers, Space Age provides a form of server-sideapplication programming modeled after Clojure's de facto web programmingstandard, Ring, but further simplified for Geminispace.

Essentially, dynamic routes can be programmed as simple functions thattake a request map and return a response map. All you have to do is adda *.clj file anywhere under your document root (or under a user's/home/username/public_gemini directory), make it executable, and definea main function within it that will be called whenever that page isrequested by a Gemini client.

So rather than messing with environment variables and printing tostdout, you can just write pure functions that take and receive data.Fun times for functional programmers of all ages!

(happy :hacking) Gary

-- GPG Key ID: 7BC158EDUse `gpg --search-keys lambdatronic' to find meProtect yourself from surveillance: https://emailselfdefense.fsf.org=======================================================================() ascii ribbon campaign - against html e-mail/\ www.asciiribbon.org - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.See http://www.gnu.org/philosophy/no-word-attachments.html