element-template/static.go
Snider 5143c211d3 feat: modernise template with core/go-api provider pattern
Replace Cobra CLI + raw net/http with core/go-api Engine.
DemoProvider implements RouteGroup for plug-and-play registration.
Lit element updated to fetch from Go API.
Add .core/build.yaml and CLAUDE.md.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-14 09:49:41 +00:00

17 lines
425 B
Go

// SPDX-License-Identifier: EUPL-1.2
package main
import (
"io/fs"
"net/http"
)
// noCache wraps a filesystem with cache-busting headers for development.
func noCache(fsys fs.FS) http.Handler {
fileServer := http.FileServer(http.FS(fsys))
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
fileServer.ServeHTTP(w, r)
})
}