fix: remove nginx, serve frontend from Express on port 3000, fix static path

This commit is contained in:
BetterHuman
2026-05-06 03:54:32 +00:00
parent af9873ffed
commit f5067cc19f
3 changed files with 8 additions and 13 deletions
+3 -2
View File
@@ -22,7 +22,7 @@ import settingsRouter from './routes/settings';
import notificationsRouter from './routes/notifications';
const app = express();
const PORT = process.env.PORT || 5000;
const PORT = parseInt(process.env.PORT || '3000', 10);
// Security
app.use(helmet({ contentSecurityPolicy: false }));
@@ -71,7 +71,8 @@ app.use('/api/v1/settings', settingsRouter);
app.use('/api/v1/notifications', notificationsRouter);
// Serve frontend in production
const frontendDist = path.join(__dirname, '../../public');
// __dirname = /app/dist, frontend is at /app/public
const frontendDist = path.join(__dirname, '../public');
app.use(express.static(frontendDist));
app.get('*', (req, res) => {
res.sendFile(path.join(frontendDist, 'index.html'));