Res.sendFile(path.resolve(_dirname, '.', 'build', 'index.html')) īut it doesnt work nor does it log anything at all in the console: T21:03:47.438140+00:00 heroku: Starting process with command `bin/boot` Always return the main index.html, so react-router render the route in the client I have tried modifying my server/app.js file as suggested in this: React routes are not working in facebook's create-react-app build // server/app.jsĪpp.use(morgan(':remote-addr - :remote-user ] ":method :url HTTP/:http-version" :status :res :response-time ms')) Īpp.use(express.static(path.resolve(_dirname, '.', 'build'))) Of course, per the tutorial it is supposed to display an About page.īottomline: React router is not working on heroku and I can't figure out why. I am following this wonderful tutorial: everything works up to the point where I post it to heroku and I try to navigate to and I get a 404 Not Found/nginx error. React/react router/heroku question here (it is probably heroku where it is failing).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |