Deploying a production Node.js server [closed]

  • You should really really use a framework (I recommend something like Express since it was battle-tested) unless you want to deal with sessions, cookies, middleware etc by yourself. Express is really light.
  • Starting the server with nohup: you shouldn’t do that, just start it with the regular “node” command. Also Express wraps the routes in a try-catch, so your server won’t crash in a route. However if your server does have a serious problem, you shouldn’t fear restarting it (besides, if you have 2-3 processes at least, only one will die, so there will be at least 1-2 remaining and the user won’t feel a thing).
  • For monitoring I personally prefer something more at the OS-level such as Upstart and Monit.
  • Hosting solution: since you already have your own serious hardware stuff, no need to invest money in something else. Just use a load-balancer (maybe nginx or node-http-proxy) to proxy stuff.

Leave a Comment