Answer the question
In order to leave comments, you need to log in
How to start nodejs server?
Relatively recently I started writing for nodejs.
I start the server through the console. How does it work in production for you? Does someone monitor the script all the time and restart it via the console?!
It seems at the same time it still often crashes due to errors.
Answer the question
In order to leave comments, you need to log in
For production, you need to write a systemd unit.
https://www.digitalocean.com/community/tutorials/h...
Yes, just everything.
Set npm install -g forever
Allow it to run Node scripts - apt-get install nodejs-legacy
Run from the application directory: forever start server.js
(everything is a little more complicated, but for starters and general understanding it will start like this)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question