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's
Gemini Server):
https://gitlab.com/lambdatronic/space-age
Since Clojure compiles to Java bytecode, it's fully cross-platform. You
just need to install a recent JDK and the Clojure command line tool. Key
generation is handled with a single command, which is documented in the
project'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 port
1965. To serve up a different directory, just replace "." with the
directory path.
Uniquely among Gemini servers, Space Age provides a form of server-side
application programming modeled after Clojure's de facto web programming
standard, Ring, but further simplified for Geminispace.
Essentially, dynamic routes can be programmed as simple functions that
take a request map and return a response map. All you have to do is add
a *.clj file anywhere under your document root (or under a user's
/home/username/public_gemini directory), make it executable, and define
a main function within it that will be called whenever that page is
requested by a Gemini client.
So rather than messing with environment variables and printing to
stdout, 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: 7BC158ED
Use `gpg --search-keys lambdatronic' to find me
Protect 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