Update index.js

This commit is contained in:
viper151
2025-08-06 19:30:05 +03:00
committed by GitHub
parent 5ba62a2b7b
commit 8774aa4289

View File

@@ -898,7 +898,12 @@ app.post('/api/projects/:projectName/upload-images', authenticateToken, async (r
// Serve React app for all other routes
app.get('*', (req, res) => {
if (process.env.NODE_ENV === 'production') {
res.sendFile(path.join(__dirname, '../dist/index.html'));
} else {
// In development, redirect to Vite dev server
res.redirect(`http://localhost:${process.env.VITE_PORT || 3001}`);
}
});
// Helper function to convert permissions to rwx format