I started to use react-router v4. I have a simple
in my app.js with some navigation links (see code below). If I navigate to localhost/voca
If you use Webpack check your configuration in part of server configuration for the "contentBase" attribute. You can set by this example:
devServer: {
...
contentBase: path.join(__dirname, '../')
...
}
If you are using Express (not Webpack), this worked for me..
app.get('/*', function(req, res) {
res.sendFile(path.join(__dirname, 'path/to/your/index.html'), function(err) {
if (err) {
res.status(500).send(err)
}
})
})