re: Deploying a React app with React-Router and an Express Backend VIEW POST

VIEW PARENT COMMENT VIEW FULL DISCUSSION
 

You would need to run npm start for both locally. It works in production as well, I'll add a section on deployment tonight.

 

For running locally from your ./client folder, you can modify your package.json script to start both at the same time:

"scripts": {
    "start": "node ../index.js | react-scripts start",
    ...
}

And when you C to terminate batch job, it will terminate both front and back localhosts.

 

Thanks. I would guess you would want to compile the code in the client folder so yeah, would love to read about that process

I've added a short section, I hope that everything is clear

Yes this makes sense. Your creating a Node Heroku setup and it will run that. Thanks

code of conduct - report abuse