//go:build !exclude_frontend package frontend import ( "bytes" "embed" "fmt" "io" "io/fs" "mime" "net/http" "path" "strconv" "strings" "time" "github.com/gin-gonic/gin" "github.com/pocket-id/pocket-id/backend/internal/middleware" ) //go:embed all:dist/* var frontendFS embed.FS // SvelteKit generates both gzip and Brotli sidecars for these extensions when precompress is enabled var precompressedExtensions = map[string]struct{}{ ".css": {}, ".html": {}, ".js": {}, ".json": {}, ".md": {}, ".mdx": {}, ".mjs": {}, ".svg": {}, ".txt": {}, ".wasm": {}, ".xml": {}, } // This function, created by the init() method, writes to "w" the index.html page, populating the nonce var writeIndexFn func(w io.Writer, nonce string) error func init() { const scriptTag = "