package main import ( "embed" "io/fs" "net/http" "os" ) //go:embed all:embed var Files embed.FS func FrontendFileSystem() (http.FileSystem, string) { if os.Getenv("USE_EMBEDDED") == "false" { return http.Dir("../frontend/build"), "" } return http.FS(Files), "embed/" } func FrontendFS() fs.FS { if os.Getenv("USE_EMBEDDED") == "false" { return os.DirFS("../frontend/build") } return Files }