serve express

This commit is contained in:
2ManyProjects 2025-03-26 22:53:22 -05:00
parent e92ae9de5b
commit 0ea288bd21

View file

@ -3,10 +3,8 @@ const path = require('path');
const app = express(); const app = express();
const PORT = process.env.PORT || 3888; const PORT = process.env.PORT || 3888;
// Serve static files from the React build
app.use(express.static(path.join(__dirname, 'build'))); app.use(express.static(path.join(__dirname, 'build')));
// Serve index.html for all routes to support client-side routing
app.get('*', (req, res) => { app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'build', 'index.html')); res.sendFile(path.join(__dirname, 'build', 'index.html'));
}); });