Documentation
¶
Overview ¶
Package frontend exposes the production React build as an embedded filesystem. Keeping the build artifact behind this package lets the HTTP server serve the app without knowing how Bun names or lays out generated assets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Document ¶
Document returns the embedded entry document with route-specific metadata, externalized for the given base path like Index.
func Index ¶
Index returns the React entry document embedded in the binary, externalized for the path prefix the request resolved ("" for a root deployment).
The build uses Vite's relative base, so chunk-to-chunk resolution inside the bundle rides import.meta.url and needs no rewriting; only this document's own references are document-relative and would break on nested SPA routes (/sessions/123). Index rewrites them to absolute prefixed paths and injects the prefix as window.__AKARI_BASE_PATH__, which the router basename and the API client read back. The prefix arrives validated (config.NormalizePathPrefix), so it is safe to interpolate into markup.