-
How to Do Deployment of Repository on Public Server in Node.Js App
almost 7 years ago
-
almost 7 years ago
You need to setup the server for your NodeJs application.
Create a Linux machine on Google cloud, install MongoDB and NodeJS on it (make sure to use the same version which you used while development) Or you can use pre-built compute engine offered by Google cloud as well https://cloud.google.com/docs/choosing-a-compute-option it depend on your need.
When you completed the Infra setup next step is to put your code on to the machine and follow these steps:- Install npm packages
npm install
- Run the application
node <pathToFile.js>
- To run application on background use PM2 or forever.
pm2 start npm -- start
- Install npm packages
1 Answer(s)