π TL:DR :
Serving react app is pretty simple if we does it directly through development environment( i.e. serve apps directly including ...
For further actions, you may consider blocking this person and/or reporting abuse
Hey Sudarshan ,
I have a query.
I am unable to connect the dots here. Now I have the react front end project ready with build folder and Nodejs is installed on a Linux server . Now how can I deploy this react project on to nodejs? I wanted nodejs to serve both static and dynamic requests.
nice question. So, when you create a
build
folder from react app then basically you end up with html, css and minified JS stuff. Now, for final deployment you will move this build folder to the Linux server and place it into the same directory as of your node.js server. Once done you can follow above article fromDeployment Stuff
Hope it will be helpful
Yes Sudarshan , this was the best article that I followed.
this is nice, this could work if a need to deploy a MERN app in a private server running other apps in LAMP?? there i need virtual host configs i think, but your setup could pull off this apache node deployment??
sorry for delayed reply !
I don't have proper understanding of apache. But, I can assure you it would work with your other apps until it's port is available !
Hope this will be helpful
Hi Sudarshan,
I have a query.
In development setup, we need to start the node server as well as the front end react app.
For production setup, we have built the react front end and have those as static data in build folder. Start only the node server.
Is my understanding right ? Please clarify.
You got that !
Because, we are serving the react build folder as the static asset of our nodejs backend π
Thanks for the clarification, Sudarshan.
One query which has been in my mind for a long time is => "Why do we need a Nodejs server? If my React app is connecting to an external api (Java for eg) can't we have just the React front end ?"
it's absolutely fine !
You can use node.js, django, spring / struts, rails or anything. But, you have to find a way to serve assets using that specific framework or technology
this is so simple...great..:
This is super interesting