Skip to main content

Module www

Module www 

Source
Expand description

Temp static file store + minimal localhost HTTP server.

Jan (and other tools) pipe HTML into unifier serve; the daemon serves it from .daemon/www/ on 127.0.0.1 so reports open in a browser without a separate static-file stack. Persistent keys are also readable at /keys/… so HTML boards can deep-link into results.

Layout:

.daemon/www/<name>           — raw body bytes
.daemon/www/<name>.meta.json — { content_type, created_at, expires_at? }
.daemon/http.port            — bound TCP port
GET /keys/<key>              — live key value from HotStore
GET /keys[/prefix]           — list present keys (optional prefix)

Structs§

WwwMeta

Functions§

base_url
entry_url
key_url
HTTP URL for a persistent key (/keys/<key>).
list
load_meta
publish
Write body + meta under .daemon/www/<name>.
read_port
remove
spawn
Spawn the localhost HTTP listener. Returns the bound port. http_activity is set true on each accepted request so the daemon idle timer stays fresh while browsers are hitting temp reports.
validate_name
Validate a publish name: no slashes, no .., printable path segment.
wrap_html
Wrap a report body in Unifier chrome for interactive Jan HTML export.