Documentation
¶
Overview ¶
Package webui embeds the gofer web console static assets into the binary so `serve` can mount the SPA without any external files.
A bare `go build` (without first running `make web`) still compiles because dist/ always contains placeholder.html — the //go:embed directive needs at least one file present. When a real build is present (dist/index.html), Handler serves the SPA with index.html fallback for unknown routes; otherwise it serves the placeholder page.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler returns the web console static handler and whether a real build is present (true) vs the build-time placeholder (false). When dist/index.html exists it serves the SPA (unknown routes fall back to index.html); otherwise it serves the placeholder page for any GET. Callers (the HTTP server) GET-gate requests before delegating here.
func HandlerForDir ¶
HandlerForDir serves the web console from an on-disk directory (dev convenience, P7): `gofer serve --web-dir web/dist` avoids re-embedding via `make web` on every front-end change. dir must be the built SPA root (containing index.html). Returns the handler and whether a real build is present (index.html exists).
Types ¶
This section is empty.