Configure Node.js to log to a file instead of the console

Update 2013 – This was written around Node v0.2 and v0.4; There are much better utilites now around logging. I highly recommend Winston Update Late 2013 – We still use winston, but now with a logger library to wrap the functionality around logging of custom objects and formatting. Here is a sample of our logger.js https://gist.github.com/rtgibbons/7354879 Should be as … Read more

Cannot access mongodb through browser – It looks like you are trying to access MongoDB over HTTP on the native driver port

18 I open terminal and enter the following commands which then outputs I open another terminal and enter which open the mongo shell and prompts for mongo commands, but when I go to localhost/27017 I receive the following message: I created a simple nodejs application using express and when I POST data it seems the … Read more

What does `node –harmony` do?

Typing man node has this on the harmony flag: So –harmony is a shortcut to enable all the harmony features (e.g. –harmony_scoping, –harmony_proxies, etc.) From this blog post, it seems harmony enables new ECMAScript 6 features in the language. The reason your file won’t run without harmony is because app.js is probably using non-backward compatible … Read more