feat(frontend): add files
build / Go-Build (push) Failing after 15s

This commit is contained in:
2026-06-24 11:58:59 +02:00
parent 8f59f80eb2
commit d1d49ecc49
39 changed files with 3607 additions and 3 deletions
+21 -3
View File
@@ -1,6 +1,24 @@
package outfitvotingabi26
package assets
import "embed"
import (
"embed"
"io/fs"
"net/http"
)
//go:embed frontend
//go:embed frontend/dist/*
var frontendFS embed.FS
func HttpServer() http.Handler {
fs, err := fs.Sub(frontendFS, "frontend/dist")
if err != nil {
panic(err)
}
return http.FileServerFS(fs)
}
func ServeIndex(w http.ResponseWriter, r *http.Request) {
file, _ := frontendFS.ReadFile("frontend/dist/index.html")
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.Write(file)
}