Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PWARootFiles = []string{
"/sw.js",
"/site.webmanifest",
"/favicon.svg",
"/favicon-32x32.png",
"/apple-touch-icon.png",
"/icon-192.png",
"/icon-512.png",
}
PWARootFiles are the root-level build outputs a browser fetches before any session exists: the progressive-web-app manifest and service worker, plus the icons the manifest references. None of them carry user data.
The server exempts exactly these paths from session checks. Declaring them next to the files they name, rather than restating them in the auth middleware, means renaming an icon cannot silently make the Web UI uninstallable: the paths and the exemption move together, and TestPWARootFilesArePublished fails the moment one stops shipping.
Functions ¶
func SPAHandler ¶
SPAHandler serves the built React SPA. For paths matching a file in static/dist/ it serves that file; all other paths receive index.html (SPA fallback). When the SPA has not been built, a minimal HTML shell is served so that the server stays functional and tests can assert on page routes.
func StaticHandler ¶
StaticHandler serves files from the embedded static/ directory at GET /static/.
Types ¶
This section is empty.