Run pm2 with Environmental Variable

Spread the love

PM2 is an advanced production process manager for Node JS. You can get better reports, info about your running apps on Node JS Server. The best service that i got till now to host Node JS application is Digitalocean. They provide you with private VPS (a.k.a droplet) where you can run your Node JS applications. If you are looking for VPS, i suggest you to signup using this link.

We can run your app.js with PM2 as following:

Normally if you want to run you Node JS app with Env_var, you can do it like this:

But Now if you are managing it with pm2, you can do the same using following command:

 

Leave a Reply

Your email address will not be published. Required fields are marked *