DEV Community

Discussion on: Deploying a React app with React-Router and an Express Backend

Collapse
 
nburgess profile image
Nicolas Rousseau Burgess

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

Collapse
 
jrock2004 profile image
John Costanzo

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

Thread Thread
 
nburgess profile image
Nicolas Rousseau Burgess

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

Thread Thread
 
jrock2004 profile image
John Costanzo

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

Collapse
 
mccoyrjm profile image
Ryan McCoy

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.