package web import ( "embed" "io/fs" "net/http" "path" ) //go:embed all:dist var distFS embed.FS func FileSystem() http.FileSystem { sub, _ := fs.Sub(distFS, "dist") return http.FS(sub) } func Index() ([]byte, error) { return distFS.ReadFile("dist/index.html") } func ServeAsset(filepath string) ([]byte, error) { fullPath := path.Join("dist/assets", filepath) return distFS.ReadFile(fullPath) }