Skip to content

Static web content: the host serves resources/public (the engines' static.html.folder) - #73

Merged
acn-ericlaw merged 2 commits into
mainfrom
feat/static-content
Nov 20, 2026
Merged

acn-ericlaw merged 2 commits into
mainfrom
feat/static-content

Conversation

@acn-ericlaw

@acn-ericlaw acn-ericlaw commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What

The host serves static web content, the way both engines do:

  • static.html.folder is honoured as the Java engine's key; its default is the Rust engine's location, resources/public next to the application file, under the packs' resources rule (a relative value is under the application file's folder, never the working directory; file: prefixes an absolute path; an empty value turns the service off; AppConfig.app_dir names the application file's folder).
  • A GET or HEAD that no host path, extension route or function claims is answered with the file the path names, index.html for a folder, so a folder's index.html replaces the embedded landing page at / while /info, /health and the other host paths stay the host's.
  • Content types from the engines' table by extension (text/javascript, text/css, image/svg+xml, fonts, images; application/octet-stream otherwise), an ETag with 304 on If-None-Match, Cache-Control: no-cache for HTML so a redeployed page is revalidated while hashed assets stay cached.
  • Never found, in the engines' error shape: a hidden segment (so .. too), a symbolic link that leaves the folder, anything that is not a regular file. Not ported: the Java engine's static-content filter, its no-cache-pages list and its mime.types section.
  • 12 new tests (tests/test_static_content.py, one in tests/test_config.py); README, the three guides and the CHANGELOG updated; the 2026-08-24 "no static file service by design" note withdrawn.

Gates: ruff clean, basedpyright 0 errors, pytest 763 passed / 75 skipped. Driven live through mercury-serve with a bundle in resources/public: the page with no-cache and an ETag, the script as text/javascript, HEAD, 304, the actuator and the error shape untouched.

Why

The 2026-11-20 sprint's first step. The agent-question app's React front-end will be built once in the Node.js pack and deployed into both packs' extensions/agent-question/resources/public, served by each backend from its own origin (no CORS), the way the engines' Playground ships its web app. Neither pack could serve a file until now, unlike both engines. The Node twin is in lockstep: mercury-nodejs #138.

🤖 Generated with Claude Code

acn-ericlaw and others added 2 commits November 20, 2026 15:56
…tatic.html.folder, served for the paths nothing else claims

The host serves the files of static.html.folder (the Java engine's key) from resources/public next to the
application file by default (the Rust engine's location, under the packs' resources rule) for any GET or HEAD
that no host path, extension route or function claims: index.html for a folder, so a folder's index.html
replaces the embedded landing page at /; the content type by extension from the engines' table; an ETag with
304 on If-None-Match; Cache-Control: no-cache for HTML; a hidden segment, a symbolic link out of the folder or
anything that is not a regular file not found, in the engines' error shape. AppConfig.app_dir names the
application file's folder. Docs, README and CHANGELOG updated; the 2026-08-24 "no static file service" note
withdrawn.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ad and the decision

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@acn-ericlaw
acn-ericlaw merged commit b69d807 into main Nov 20, 2026
5 checks passed
@acn-ericlaw
acn-ericlaw deleted the feat/static-content branch November 20, 2026 08:10
acn-ericlaw added a commit that referenced this pull request Nov 20, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant