21 lines
351 B
Go
21 lines
351 B
Go
package web
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
"net/http"
|
|
)
|
|
|
|
//go:embed all:dist
|
|
var staticFiles embed.FS
|
|
|
|
// FS returns the embedded frontend/dist subtree.
|
|
// Falls back to an empty FS during development (before `make build` runs).
|
|
func FS() fs.FS {
|
|
sub, err := fs.Sub(staticFiles, "dist")
|
|
if err != nil {
|
|
return http.FS(http.Dir(""))
|
|
}
|
|
return sub
|
|
}
|