File size: 477 Bytes
d761868
 
 
 
 
b1e7726
d761868
 
 
b1e7726
d761868
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const express = require('express');
const path = require('path');
const app = express();

// Serve static files from the React app build directory
app.use(express.static(path.join(__dirname, 'build')));

// Handles any requests that don't match the ones above
app.get('*', (req, res) =>{
    res.sendFile(path.join(__dirname, 'build', 'index.html'));
});

const port = process.env.PORT || 7860;
app.listen(port, () => {
    console.log(`Server is running on port ${port}`);
});