- 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
25 lines
409 B
Go
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
|
|
}
|