Documentation
¶
Overview ¶
Package ui serves the Karakoram single-page web application.
The compiled SPA (built by `npm run build` in ./ui, which writes to internal/ui/dist) is embedded into the binary when Go is invoked with the `ui` build tag. Without the tag the package still compiles and the handler serves a minimal "UI not built" page, so server builds and tests never depend on a Node toolchain.
Index ¶
Constants ¶
const Built = false
Built reports whether the SPA is compiled into this binary.
Variables ¶
This section is empty.
Functions ¶
func Assets ¶
Assets returns the embedded SPA files (index.html at the root) or nil when the binary was built without the `ui` tag.
func Handler ¶
Handler returns an http.Handler serving the SPA with history-API fallback: unknown paths without a file extension return index.html so client-side routes deep-link correctly. Hashed build assets under /assets/ are served as immutable; everything else (notably index.html) is revalidated on every request so deploys take effect immediately.
Types ¶
This section is empty.