Categories
Tags
a Accessibility Advanced Algorithms Alias Bash bash Basics Beginners Best Practices Big O bun cat cd CLI Comments Container Elements Container Queries cp css CSS Data Structures deno Doctype Download Editors Error Examples Features figure File Watching Filesystem fish Fish Shell footer frontend Guide header Hello World History Homebrew HTML HTML5 humor img javascript JavaScript Learning less Links linux Linux ls macOS Media Queries meta Mobile-First mv Netcat Networking Node.js npm Package Manager picture pm2 Productivity programming Programming pwd Responsive Design Responsive Images rmdir Scalability section Semantic HTML shell Shell Shell Script Shells srcset State Management Structure Svelte Svelte Store SvelteKit svg Tables tail Text Formatting Tools touch Troubleshooting Tutorial Unix ux Vim web development Web Development web-development webdev
107 words
1 minutes
How to use pm2 to serve a Node.js app
How to use pm2 to serve a Node.js app
PM2 is a popular process manager for Node.js applications. This guide provides steps to use PM2 to serve a Node.js app.
Installing PM2
To install PM2 globally, use the following command:
npm install -g pm2
Serving a Node.js App
To serve a Node.js app using PM2, use the following command:
pm2 start app.js
Managing the App
You can manage the app using various PM2 commands:
pm2 list
: List all running apps.pm2 stop app.js
: Stop the app.pm2 restart app.js
: Restart the app.pm2 delete app.js
: Delete the app from PM2.
Conclusion
By using PM2, you can easily manage and serve your Node.js applications. PM2 provides powerful features for process management and monitoring.
How to use pm2 to serve a Node.js app
https://zxce3.net/posts/how-to-use-pm2-to-serve-a-node-js-app/