Skip to main content

Module serve

Module serve 

Source
Expand description

Serving the static surfaces of a resolved topology.

One arm in the router asks this: does a static surface own the path? Every discovered StaticDirectory is answered here, and a surface that did not exist when this file was written is served because it was discovered, not because an arm was added for it. The routes the executable answers itself — the JSON index, the OpenAPI document, the Swagger shell, MCP, the Cockpit — are not dispatched here: they differ in behaviour rather than in data, and a variant per existing arm would be the match again with more ceremony (ADR 0013).

The boundary this module defends: only a resolved surface’s own directory is reachable, a request may not walk out of it, and only a closed set of media types is answered.

Structs§

StaticSurfaces
The static surfaces of a topology, ready to answer.

Functions§

media_type
The media type of a file, or None when the set does not hold it.
safe_relative
A request path’s relative part, refused before the filesystem is touched when it holds anything but the characters a generated report uses, an empty segment, . or ...