Pm2 Restart App Development Tutorials, Guides & Insights
Unlock 1+ expert-curated pm2 restart app tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your pm2 restart app skills on DeveloperBreeze.
Adblocker Detected
It looks like you're using an adblocker. Our website relies on ads to keep running. Please consider disabling your adblocker to support us and access the content.
Cheatsheet
PM2 Cheatsheet
module.exports = {
apps: [
{
name: 'app-name',
script: 'app.js',
env: {
NODE_ENV: 'development',
},
env_production: {
NODE_ENV: 'production',
}
}
],
deploy: {
production: {
user: 'username',
host: 'your-server.com',
ref: 'origin/master',
repo: 'git@github.com:your-repo.git',
path: '/var/www/your-app',
'post-deploy': 'npm install && pm2 reload ecosystem.config.js --env production',
}
}
}; pm2 deploy ecosystem.config.js productionOct 14, 2024
Read More