fix: correct public dir path for Docker (dist/src → ../../public)
This commit is contained in:
+3
-3
@@ -45,9 +45,9 @@ app.get('/api/health', (_req, res) => {
|
||||
});
|
||||
|
||||
// ─── Static files (production) ───────────────────────
|
||||
// In Docker, client dist is at /app/public
|
||||
// Locally after build, resolve relative to compiled output
|
||||
const publicDir = path.resolve(__dirname, '../public');
|
||||
// In Docker: __dirname = /app/dist/src → ../../public = /app/public
|
||||
// Locally: __dirname = server/src → ../../public (not used in dev)
|
||||
const publicDir = path.resolve(__dirname, '../../public');
|
||||
app.use(express.static(publicDir));
|
||||
|
||||
// SPA fallback — serve index.html for all non-API routes
|
||||
|
||||
Reference in New Issue
Block a user