leaving this here for anyone that might be encountering the same issue! Here's how I fixed it, I just needed to add a route that matches any (*) that don't match exactly '/', and serve the react app:
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
// Handles any requests that don't match the ones above
app.get('*', (req,res) =>{
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
leaving this here for anyone that might be encountering the same issue! Here's how I fixed it, I just needed to add a route that matches any (*) that don't match exactly '/', and serve the react app:
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
// Handles any requests that don't match the ones above
app.get('*', (req,res) =>{
res.sendFile(path.join(__dirname, 'build', 'index.html'));
});
Cheers!
(*) did the trick for me too :)