How do I leave Node.js server on EC2 running forever?

前端 未结 5 867
逝去的感伤
逝去的感伤 2020-12-22 16:11

As you can tell by my question, I\'m new to this...

I built my first website, I set up my first Node.js server to serve it and then pushed everything live on EC2.

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-22 16:51

    I worked with the valid answer for a while but some times the screen just end with no reason also screen has no balance loader and others features that in a production enviroment you should care , Currently I use a npm component to do this job.

    https://www.npmjs.com/package/pm2

    This is so easy to use.

    $ npm install pm2 -g
    

    then just start your app with pm2 like this

    $ pm2 start app.js
    

    In the above link you can find diferents tasks to perform if you need.

    Hope this help the newbies like me.

提交回复
热议问题