ctrlplusb / react-universally

A starter kit for universal react applications.
MIT License
1.7k stars 244 forks source link

Deploy to local node server or Azure #592

Open hitesh97 opened 5 years ago

hitesh97 commented 5 years ago

Hi Guys, Came across this project as I am beginning my journey to Universal React App. This project seems a very comprehensive and very well documented application hence, Hoping to use it.

I cannot seem to understand, How will I deploy this application Locally or on Azure?

When I build production build using 'yarn build' it creates 'build' directory with 'client' and 'server' files. However, when I take the 'build' directory and copy / host it on another machine / upload it to Azure, I cannot seem to run/execute server script by simply giving command 'node index.js' from 'server' directory!

Is there anything I am missing? Any help will be grateful and help me choose this project as my base project to start with!

Thanks once again in advance.

mschipperheyn commented 5 years ago

There are many ways in which you can do this. Personally, I use dokku, which gives you a Heroku like experience but using generic cloud servers.

unleashit commented 5 years ago

Just tried and it works fine for me. What are you getting in the console?

There's no particular way to deploy this from any other node project. The only difference from standard React is if you don't host the static files on the same machine as the server, you have to specify where your static assets are in the output html (and remove the local static assets path from Node).

image