NodeJS in production

I have to ask you guys a question. I just started learning NodeJS for a project with my friends. Now we have reached a point in our planning that we began to think about how the NodeJS solution is being deployed in production. Do we need a web server for this (IIS or Apache)? My initial thought is no, as this will force ports to be advertised twice, once on the web server and once in NodeJS code. Or should NodeJS start as "node server.js"?

+4
source share
1 answer

To start NodeJS, you are just node server.js , but there are several enhanced extensions that handle this. This way you can run node on Windows, but I highly recommend UNIX platforms through SSH access to your server (most VPS have this). If you cannot afford this type of server, I would go with Heroku , Dotcloud or Nodejitsu (three of them are cloud hosting).

  • Forever that restarts your node server upon failure
  • Nodemon that restarts your node server when the file has been modified (or any JS files in the specified directory)

There may be more, so if I find anything useful, I will edit this post.

+7
source

Source: https://habr.com/ru/post/1434120/


All Articles