N
N
newaitix2019-04-30 11:10:36
Node.js
newaitix, 2019-04-30 11:10:36

How to make the server always running?

There is a vds server.
OS ubuntu.
Well and through ssh I work with it.
I raise the server in putty
nodemon /home/netwixell/www/run.js
Well, 46.229.213.73:3000 I get Hello, world!

var http=require('http'),
  server=new http.Server(),
  port=3000;
server.listen(port);
server.on('request', function(req, res){
  res.end("Hello, world!");
});
console.log('Server running on port '+port);

But if I close the terminal or turn off the computer, then naturally everything falls.
Now the question is how to make the server always running. ?
If there was a gui and I would have access to drp, I could connect, make an appointment and leave for tea.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sim3x, 2019-04-30
@sim3x

How to deploy nodejs with systemd

V
vanoc, 2019-04-30
@Zoro

tmux, screen

U
Urukhayy, 2019-04-30
@Urukhayy

# nohup nodemon /home/netwixell/www/run.js &
ENTER

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question