I am using NodeJs + React in my application. I am using express in NodeJs. I created my sample app using 'create-react-app' npm.
I used NodeJs for calling the oauth token from react app. I mentioned this approach in this post Calling a secured REST api from Javascript without user login screen .
I added this command below to start the NodeJs together with my react app. It works.
"scripts": {
"node": "react-scripts-ts build & node server"
}
The issue is that I don't get the real time tracking feature that comes with 'create-react-app' because I am not starting the webpack-dev-server. If I made some changes, I have to run 'yarn node' to recomple and start the node js server.
My question is how to start the nodejs express without losing the 'create-react-app''s live tracking feature.
If I need to eject the 'create-react-app' and customize the script, I am fine as long as I got the following feature.
- start nodejs express - api
- load my react-app
- if there is any change in my react or nodejs express file, it should auto-reload.
Feel free to let me know if you have any question.
Thanks,
node
script, that's what is getting done. Run the dev server for HMR. Generally, that isnpm start
See github.com/gaearon/react-hot-loader/issues/… – Trager