CodeMasteryLab
Section 5

Deployment & Production

Deploy Node.js applications to production

Deployment & Production

Deploy your Node.js app to production.

Environment Variables

npm install dotenv
require('dotenv').config();

const port = process.env.PORT || 3000;

PM2 Process Manager

npm install -g pm2
pm2 start app.js
pm2 startup
pm2 save