package web import ( "embed" "io/fs" "net/http" ) //go:embed all:out var staticFiles embed.FS // StaticFS returns an http.FileSystem rooted at the embedded "out" directory. // This strips the "out/" prefix so paths like "/_next/static/..." work directly. func StaticFS() http.FileSystem { sub, err := fs.Sub(staticFiles, "out") if err != nil { panic("web: failed to create sub-filesystem: " + err.Error()) } return http.FS(sub) }