From 38a89328a93dbee10f63ce103b778c6439247c30 Mon Sep 17 00:00:00 2001 From: Daniel Arroyo Date: Tue, 7 Jul 2026 15:58:18 -0400 Subject: [PATCH] api: use webui.ServeSPA in NotFound handler instead of buggy inline logic --- internal/api/router.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) 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