How to deploy node js application with express framework with production environment variable with pm2 and generate startup script for reboot with same production environment variable.
I have used this so far
pm2 start hello.js
pm2 startup systemd
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup
systemd -u sammy --hp /home/sammy
It starts the application on reboot but in development mode