Yes, these are CGI scripts in practice. I'm just trying not to shell out to subprocesses in the interest of server responsiveness. I'm currently just thinking through how to provide as simple and intuitive an interface as possible for the script writer. Probably it will amount to some kind of handler function API that takes a request map and returns a response map in the classic tradition of all ring-based Clojure web apps. Scripts are currently run within their own auto-generated temporary namespaces, which prevents them from accidentally polluting the server's namespaces with def* forms. Any I/O to stdout is captured in a string and currently returned as the body of a "20 text/gemini; charset=utf-8" response. This is fine as a starting point, but I think I want to create something that feels more functional and less state-oriented pretty soon. I'll keep you posted as it progresses. Happy hacking, Gary Petite Abeille <petite.abeille at gmail.com> writes: >> On Jul 10, 2020, at 20:38, Gary Johnson <lambdatronic at disroot.org> wrote: >> >> Any query params from the request URL are >> available to the script in a global variable called (creatively) >> "request-params". Anything you print to stdout in your script will be >> returned as the body of a text/gemini response to the client. >> >> I'm still thinking through just how much additional info I want to pass >> to these scripts and how/whether I should let them send non-success >> responses, but that's half the fun of it after all. > > Perhaps The Common Gateway Interface (CGI) could be of guidance? > > Sounds similar in principle. -- 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 Please avoid sending me MS-Office attachments. See http://www.gnu.org/philosophy/no-word-attachments.html
---
Previous in thread (6 of 9): 🗣️ Petite Abeille (petite.abeille (a) gmail.com)
Next in thread (8 of 9): 🗣️ Sean Conner (sean (a) conman.org)