web

package
v0.61.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func SPAHandler() http.Handler

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

func StaticHandler() http.Handler

StaticHandler serves files from the embedded static/ directory at GET /static/.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL