docs: add a Role in the framework section to every module README
Each module README now says where the module sits in the dependency graph, why it is its own module, and lists use cases for application developers.
This commit is contained in:
@@ -10,6 +10,16 @@ HTTP handler that serves the embedded admin SPA build under a configurable path
|
||||
|
||||
`boardwalk` embeds the compiled admin SPA (`dist/`, produced by `npm --prefix admin run build`) into the binary and serves it. The build is path-agnostic: `index.html` carries a placeholder token that the handler replaces once, at construction, with the prefix the admin is mounted under, so one build works at any backend URI. [cabana](../cabana/README.md) mounts it when it activates the admin routes. It stands in for the server-rendered backend layouts of WinterCMS, which the Go port replaces with a single-page app.
|
||||
|
||||
## Role in the framework
|
||||
|
||||
A small leaf with no framework dependencies; `cabana` is its only importer. It exists on its own because it owns the generated admin SPA bundle in dist/, which is rebuilt and drift-checked separately from Go code, and because its handler is easy to test against an in-memory file system. Application code normally does not import it: `cabana` mounts it under the backend prefix.
|
||||
|
||||
Use cases:
|
||||
|
||||
- Serve the admin SPA from the application binary with no separate frontend deployment.
|
||||
- Move the admin to another path by changing the backend URI; the bundle is rewritten for the prefix at boot.
|
||||
- Serve as the pattern to copy when a plugin embeds its own static site (the embedding and cache headers, not the admin-only security headers).
|
||||
|
||||
## Features
|
||||
|
||||
- Serves the embedded build under any prefix, rewriting relative asset URLs and the admin base meta in `index.html` for that prefix (`boardwalk.RewriteIndex`).
|
||||
|
||||
Reference in New Issue
Block a user