Pm2 logs in to the server according to the specified configuration, pulls the code update of the remote repository, and then executes some specified commands (such as packaging, etc.).

Create a local project and associate it with a remote repository

  1. Create a new project called Web locally, enter the project and create a simple Nodejs fileapp.js.
mkdir web && cd web
vi app.js
Copy the code

Edit the file as follows. Save the configuration and exit :wq! .

// app.s

const http = require('http');

const homePage = ` 
         
       
       Document