Answer the question
In order to leave comments, you need to log in
How to set up PM2?
I started to deal with Node.js and got stuck with pm2 I run
the application on express.js like this pm2 start processes.json
The processes.json file itself
{
"apps": [
{
"name": "Application",
"script": "server.js",
"port": "3000",
"host": "127.0.0.1",
"cwd": "./",
"exec_interpreter" : "node",
"watch": "true"
}
]
}
Answer the question
In order to leave comments, you need to log in
The problem was in the last lines of the server. Thanks for the help.
// If someone ran: "node server.js" then automatically start the server
if (path.basename(process.argv[1], '.js') == path.basename(__filename, '.js')) {
module.exports.start()
}
and what is the problem? explain
and there is nothing in the config, for the sake of which it was worth starting it
from the root of the site
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question