From the course: Advanced Express
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Deployment and operation with PM2
- [Instructor] In this video, I will deploy our application to a server using PM2. PM2 is a very powerful process manager that also comes with a feature that lets us deploy a project. This is a good option for smaller projects. In larger projects you might have a whole deployment pipeline that takes care of that. As server, I'm using an EC2 instance, but any host on the internet will do. On this host, I installed Node.js and PM2 and I created the user Node.js and a directory on Node.js deploy. I also added the public SSH key of my development machine to the list of authorized keys. PM2 tool relies on Git to deploy project from. For that I pushed it to a GitHub repository. Additionally, I copied my .env file into the deploy directory because it's not published to GitHub for obvious security reasons. On MongoDB Atlas, I also white listed the IP of my server so that it can then connect to the MongoDB cluster. To setup the deployment on all development machine, we first have to install…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Tuning Express performance: NODE_ENV and compression4m 6s
-
(Locked)
Tuning Express performance: Further measures2m 2s
-
(Locked)
Add logging5m 3s
-
(Locked)
Using the Node.js cluster module5m 12s
-
(Locked)
Securing an Express application2m 44s
-
(Locked)
Deployment and operation with PM24m 37s
-
(Locked)
Running behind a web server5m 8s
-
(Locked)
-