From a40cac449176532f0fa14ea7815d76abe58e8990 Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Thu, 11 Dec 2025 08:48:58 -0500 Subject: [PATCH] Fix static file routing - prevent catch-all from intercepting static files --- server/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/index.js b/server/index.js index 376f0c5..7d9a43c 100644 --- a/server/index.js +++ b/server/index.js @@ -395,7 +395,12 @@ app.use(express.static(path.join(__dirname, '../client/build'), { } })); -app.get('*', (req, res) => { +// Only serve index.html for non-file routes (no extension) +app.get('*', (req, res, next) => { + // If the request has a file extension, let static middleware handle it or 404 + if (path.extname(req.path)) { + return next(); + } res.sendFile(path.join(__dirname, '../client/build/index.html')); });