Title: How to make background API server use hot reloading in a React project?
Tags: node.js;reactjs;webpack
Question: When I save changes to my client-side code, the browser hot-reloads as expected. But when I make changes to my server code, no hot-reloading occurs. This is a problem because we want to just run 1 command (i.e. ```npm start```) to launch our React webpack-dev-server AND our API server, and rerunning the entire ```npm start``` to manually relaunch the server after changes is slow (because it unnecessarily relaunches the React dev-server as well). Also sometimes we forget to relaunch the server code, so in reality it should just hot-reload anyway.

I've looked across the internet and surprisingly can't find any straightforward solutions. I feel like I shouldn't have to eject the entire project and go deep into the webpack configurations to get this to work. 

This is what the ```npm start``` portion of my ```package.json``` looks like now:

```"scripts": {
 46     "start": "concurrently --kill-others \"react-scripts start\" \"node server.js\"",
...
}
```

Is there perhaps a way I can do "react-scripts start" with a different target or something?

Comment: Man I feel stupid. I must've seen nodemon a million times but never really looked into it. All my research was in trying to figure out how to get this to work with webpack. Glad the answer was so simple, thank you!

Comment: Use Nodemon: https://www.npmjs.com/package/nodemon. `"concurrently --kill-others \"react-scripts start\" \"nodemon server.js\"",`. Make sure to ignore watching the client folder, otherwise it'll restart on client saving.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2019:00:08/17/19', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<node.js><reactjs><webpack>', 'Title': 'How to make background API server use hot reloading in a React project?', 'ViewCount': 101, 'id': 57538796, 'user_AboutMe': '', 'user_AccountId': 9829684.0, 'user_DisplayName': 'Aaron Levin', 'user_Reputation': 31.0, 'user_Views': 9.0, 'user_id': 7281715.0}}