Documentation
¶
Overview ¶
Package ui serves memini's embedded single-page admin UI (Preact + Vite). dist/ is a build artifact (gitignored; only .gitkeep is tracked) embedded at compile time. The Docker image builds it; locally use `mise run ui`. Without it the binary still boots and serves a placeholder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶ added in v0.5.10
Handler returns the SPA handler that Mount installs as a catch-all. It is exposed so the server can serve the shell on a dedicated listener (see MEMINI_UI_ADDR) instead of the main API port, keeping the token-embedding shell off any port that carries the token-free API.
func Mount ¶
Mount serves the SPA at / on r. Requests for real built assets are served from the embedded filesystem; everything else falls back to index.html so client-side routing works on deep links and reloads.
The shell is intentionally public (no bearer auth): when MEMINI_API_KEY is set the API it calls (/v1) enforces the token. apiKey, when non-empty, is injected into the shell so the same-origin UI authenticates without the operator pasting it — which exposes the key to anyone who can load the page, so only set it where reaching the UI already implies trust.
Types ¶
This section is empty.