imc-vibe/backend/cmd/server/frontend.go
Christoph Haas 46d9ff26dd Add svelte-heros icon library
- Install svelte-heros for consistent Heroicons usage
- Replace inline SVGs for password toggle with Eye/EyeOff icons
- Fix USE_EMBEDDED mode to serve frontend from filesystem
2026-03-29 15:16:58 +02:00

25 lines
409 B
Go

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
}