score:1

Accepted answer

as per the previous person, you need to add this after your app.use routes part in your server-dev.js

app.get('*', (req, res) => {
  res.sendfile(path.join(__dirname + '/index.html'));
})

this should fix it

score:0

you can try with this sample of code (in case you are using the server for serving only the react app):

app.get('*', (req,res) =>{
    res.sendfile(path.join(__dirname+'/client/build/index.html'));
});

where you can replace the link of the index.html file as per your file structure.


Related Query

More Query from same tag