How to create environment For Reactjs frontend and Nodejs backend Deployment

1. For ReactJS frontend and Nodejs backend Deployment, Click on the new environment option in Cloudjiffy Dashboard As we have to create two environments one for reactJS frontend and another will be for Nodejs Backend 





2. Then Select Apache as the Primary Application node for the ReactJS frontend also you can enable the Built-in SSL for the same 




3. Then Click on Create Environment and once the environment is created you can deploy the deployment file







OR 

4. Upload your application package by clicking Upload in Cloudjiffy Deployment Manager.




5. You Can Browse your local file. The Cloudjiffy Deployment Manager supports .zip.tar, .tar.gz and .tar.bz2 formats

6. Note that the maximum available size of the uploaded local file is 150 MB. If your application size exceeds this limit, please use the URL for uploading.



7.  Select the package in the list and click Deploy to button.

8. Choose the environment that want to deploy your web application to. In the opened window, you will see the information on my application’s URL. Click Deploy.





9. In the same way create another environment of Nodejs and MariaDB or MySQL for backend code deployment in which we can select Nginx as Load Balancer so that we can attach Built-in SSL for the entire environment so that Nignx and NodeJS nodes are linked up it will work for both the nodes 



10. Once the node application is ready, Deploy the code. Please use zip, link OR git to upload your code at your convenience.

      Now You can deploy your backend code in the newly created environment of NodeJS 

 



11.  Test the code first by connecting the “Web SSH”

 

12. On shell run the command below:

13. If you see any errors then install/update modules using npm i command.
And you are ready to browse the nodejs application.


In case application's main file is not server.js then you need to adjust the application variable to start the node when restarting OR stop-start.

 

To do this go to nodejs application node and click on the “Addtionally” icon ( last icon in that row ) and select “Variables”

In the popup window select the “APP_FILE”  and click the edit button replace the server.js with the application file name eg index.js and save it then click on the “Apply” button at the bottom right.

 

14. To apply the changes we need to restart the Node.js server.

Now Node.js is ready to use.

Please Note: SLB is limited to 50 simultaneous connections per the request’s source address to prevent DDoS attacks.
In case the application requires more connection then please perform the next steps.

 

15. Assign a IPV4 to the load balancer

 

16. You can Bind api.somedomain.com to the environment and point it to the load balancer IP.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 204