From 817b3783f24524ceb60e90c5262f28a469ebd6e4 Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Thu, 5 Feb 2026 15:49:45 -0500 Subject: [PATCH] fix(server): fix route conflict by using /dist prefix for static assets Previously, static assets were served from the root "/" and "/assets" routes, which caused conflicts with the "/api" route. Changed to serve all static assets under the "/dist" prefix to avoid route collisions. --- internal/server/server.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/server/server.go b/internal/server/server.go index 22c35a0..a021676 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -5,8 +5,6 @@ import ( "fmt" "net/http" "os" - "path/filepath" - "github.com/sirupsen/logrus" "markdown-editor/internal/storage" "markdown-editor/internal/api" @@ -95,9 +93,8 @@ func (s *Server) serveStaticAssets() { s.log.Infof("Serving static assets from: %s", assetPath) - // Serve files from the dist directory - s.router.Static("/", assetPath) - s.router.Static("/assets", filepath.Join(assetPath, "assets")) + // Serve files from the dist directory - use /dist prefix to avoid conflicts with /api + s.router.Static("/dist", assetPath) } func (s *Server) Shutdown(ctx context.Context) error {