Documentation
¶
Overview ¶
Package pwa serves the static frontend bundle (index.html, sw.js, manifest, icons, /static/*) from the embedded asset FS.
index.html carries two Jinja directives: "{{ git_hash }}" (cache-busting query string, used several times) and "{{ ui_config_json }}" (the opaque UI config blob). We substitute both at startup once and reuse the rendered bytes per request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexHandler ¶
func IndexHandler(uiConfig json.RawMessage) http.Handler
IndexHandler serves "/" with {{ git_hash }} and {{ ui_config_json }} replaced.
uiConfig is the opaque config.UI blob delivered to the frontend as window.__UI_CONFIG__; nil/empty emits the JS literal null. It must already be valid JSON (config.Load fails loud otherwise). "</" is escaped to "<\/" so a "</script>" appearing inside the blob cannot break out of the inline <script>.
func RescueHandler ¶
RescueHandler serves the standalone /rescue console (templates/rescue.html, self-contained by design — it must work while tmux and the main app don't).
func SwjsHandler ¶
SwjsHandler serves "/sw.js" with __GIT_HASH__ replaced. Cache-Control: no-cache so iOS Safari notices SW updates.
Types ¶
This section is empty.