feat: initial commit

This commit is contained in:
2025-02-21 18:42:56 +01:00
commit ee4a65b345
81 changed files with 3441 additions and 0 deletions

View File

@ -0,0 +1,36 @@
package common
import (
"embed"
"io/fs"
"net/http"
)
//go:embed assets/*
var assetsFS embed.FS
type Handler struct {
mux *http.ServeMux
}
// ServeHTTP implements http.Handler.
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.mux.ServeHTTP(w, r)
}
func NewHandler() *Handler {
handler := &Handler{
mux: http.NewServeMux(),
}
assets, err := fs.Sub(assetsFS, "assets")
if err != nil {
panic(err)
}
handler.mux.Handle("GET /", http.FileServerFS(assets))
return handler
}
var _ http.Handler = &Handler{}