The Problem of a Test Site on NodeJS on a VPS Server
So, we have launched our test site online. However, there is a problem - if you close the terminal, the site will stop working.
We, of course, need the site to work constantly, without our connection to the server. This can be done, but to do this, we need to install a special program that will keep the script running even after disconnecting the terminal from the server.
In NodeJS, there are several libraries for this. These are forever and pm2. We will use PM2, as it keeps the script running even after a server reboot. In the next section of the tutorial, we will study this library.
Make sure that disconnecting the terminal from the server stops the site.