What a page actually is
A NomadNet page is a file under storage/pages. If the file has the execute bit set, the node runs it and serves whatever it prints to stdout. If it does not, the node serves the file as-is.
That is the whole model. There is no framework, no application server, no routing table and no request object. A page is a program that prints, in the same sense that a CGI script from 1995 is a program that prints. It starts when a request arrives, prints, and exits.
The consequences are worth stating plainly, because most of what is strange about developing here follows from them:
- There is no state between requests except what you write to disk. - A page cannot hold a connection open or push anything to a reader. - A crash produces no error page. Stderr is discarded, so a page that raises returns nothing at all and the client shows an empty document. - Anything under pages/ is served, including .py files. Keep library modules non-executable so they are read, not run.
The exception on this node is the two LXMF bots that ship with News and Books. Those are long-running processes, started separately, that attach to the Reticulum instance the node is already running. They are not pages and must never be marked executable in place.