From 3ae4abeb9fd834acfeb2d1c02961c806ebdaa559 Mon Sep 17 00:00:00 2001 From: Andy Charlwood Date: Thu, 19 Feb 2026 14:22:17 +0000 Subject: [PATCH] Fixed backend --- andy-charlwood-cv@0.0.0 | 0 dist-server/server.js | 6 +++--- node | 0 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 andy-charlwood-cv@0.0.0 create mode 100644 node diff --git a/andy-charlwood-cv@0.0.0 b/andy-charlwood-cv@0.0.0 new file mode 100644 index 0000000..e69de29 diff --git a/dist-server/server.js b/dist-server/server.js index 1507e31..34c832d 100644 --- a/dist-server/server.js +++ b/dist-server/server.js @@ -6,8 +6,8 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const app = express(); app.use(express.json()); -// Serve static files from Vite build -app.use(express.static(path.join(__dirname, 'dist'))); +// Serve static files from Vite build (dist/ is at project root, one level up from dist-server/) +app.use(express.static(path.join(__dirname, '..', 'dist'))); // Contact API endpoint app.post('/api/contact', async (req, res) => { const { name, organisation, email, subject, message } = req.body; @@ -141,7 +141,7 @@ app.post('/api/chat', async (req, res) => { }); // SPA fallback app.get('*', (_req, res) => { - res.sendFile(path.join(__dirname, 'dist', 'index.html')); + res.sendFile(path.join(__dirname, '..', 'dist', 'index.html')); }); const PORT = process.env.PORT || 3000; app.listen(PORT, () => { diff --git a/node b/node new file mode 100644 index 0000000..e69de29