NodeJS - Unanswered Questions

nodejs

  1. How can I configure Node to log to access log? You probably shouldn't. Node is typically run behind Nginx. Perhaps, you should configure Nginx to log to access log.
  2. How can we deploy Node? How can we run Node as a service?
  3. How can we support multiple virtual host with Node? Typically, you wouldn't want to do this with Node. Typically, an application should only use one virtual host. If you need to run multiple things within the same virtual host, consider using different paths. Use your load balancer. Use Apache, Nginx, etc.
  4. Should we use Node for sending static file?
  5. Is there a plan to make Node.js into a module for Apache or Nginx? Does it make sense to run Node under a multi-threaded container like Java?
  6. How can I put an operation into the background? How can we make an operation non-blocking?
  7. Event-driven may or may not make line-by-line debugging using a debugger more difficult.
  8. If we have a lot of expensive blocking operation implemented asynchronously, would Node be a good choice? Probably not. Node is single-threaded.
  9. How are those expensive blocking operation (implemented asynchronously) handled? We have to pass the request and response object to all the callback functions. Can we run Node.js inside a multi-threaded Java application?
  10. Given the importance of error handling, does Node community still use try/catch or "global error/exception handler"?
  11. I was reading https://www.airpair.com/javascript/node-js-tutorial. It says that error handling is important, but the error handling code only do console.log. How does console.log protect your application from crashing? Is there a concrete case where we must absolutely handle error? If we do not handle errors, why does our application crash? What about using a global error / exception handler via a try/catch?
  12. Can we use Backbone.js, Ember, Can.js or other front-end MVC frameworks both on the front-end and back-end with Node?
  13. Does Node have a library or module so that developer does not have to restart?
  14. Tends to encourage proper error checking (err is returned by virtually all callbacks, nagging the programmer to handle it; also, async.js and other libraries handle the "fail if any of these subtasks fails" paradigm much better than typical synchronous code. See http://stackoverflow.com/questions/1884724/what-is-node-js
  • How can we run Node inside Tomcat? I do not know this yet. I want to be able to run Node inside Tomcat to take advantage of both multi-threading (provided by Java / Tomcat) and event-driven programming or non-blocking IO (provided by Node), and I want to use Tomcat because so far it seems stable (it does not die or hang).

How can we deploy Node?

Deploying an Express based website is actually the same as deploying any other Node.js application:

  • The files are placed on the server.
  • The node process should be stopped (if it is running).
  • An npm install command should be ran in order to install the new dependencies (if any).
  • The main script should then be run again.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License