diff --git a/internal/api/router.go b/internal/api/router.go index 16bfb05..ec5e55f 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -81,17 +81,7 @@ func NewServer(cfg *config.Config, db *sql.DB, engine *syncengine.Engine) *Serve })) r.NotFound(func(w http.ResponseWriter, r *http.Request) { - if _, ok := webui.DistFS.Open("dist" + r.URL.Path); ok == nil { - http.FileServer(http.FS(webui.DistFS)).ServeHTTP(w, r) - return - } - data, err := webui.DistFS.ReadFile("dist/index.html") - if err != nil { - http.Error(w, "not found", http.StatusNotFound) - return - } - w.Header().Set("Content-Type", "text/html") - w.Write(data) + webui.ServeSPA().ServeHTTP(w, r) }) return s