Spaces:
Sleeping
Sleeping
File size: 479 Bytes
03fb333 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | const express = require('express');
const path = require('path');
const app = express();
const PORT = process.env.PORT || 7860;
// Serve static files from build directory
app.use(express.static(path.join(__dirname, 'build')));
// Handle client-side routing - return index.html for all routes
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
app.listen(PORT, '0.0.0.0', () => {
console.log(`Server running on port ${PORT}`);
});
|