Comment by ๐ฝ spc476
Re: "Custom servers with Fornax"
Next up, define some structures to map routes to routines to run, like I've done in GLV-1.12558:
โ Sample config, check the handler section
2025-09-15 ยท 8 months ago
1 Later Comment
๐ stack [OP/mod] ยท 2025-09-15 at 12:59:
I like your code, but I will probably not do that.
The goal of this project is a minimalistic drop-in server with a minimal footprint.
I don't really like the idea of supporting CGI variants or a complex routing mechanism for different directories. I'd rather run multiple application servers on different ports if I must.
And besides, so many other servers do that already (with various degrees of success, as I found out the hard way).
But there is nothing stopping someone else from adding a routing and configuration mechanism to Fornax.
Original Post
Custom servers with Fornax โ I've done a little organizing to make it easier to customize the server. At the bottom, there is a definition of a function called 'serve_url()'. Here is where the magic happens: you get a url, and you output something. The default definition just serves files: [preformatted] But you can do anything else here. For instance, if you want to show current time when the url is '/time', do this: [preformatted] [preformatted] See it in action here: [gemini link] See the...