Sunday, 9 April 2017

Trouble with catch-all routes in my node.js + react.js app

To make refreshing or writting manually urls in my node.js + react.js app without "Cannot GET /*", I'm using this code on server-side to catch all routes and return index.html :

app.all('*',(req, res) => {
res.sendFile(path.join(__dirname, 'reactjs/dist/index.html'));
});

But app simply redirecting on '/'



via Pink Zeppelin

No comments:

Post a Comment