Richard Bucker

NodeJS servers to support one page aps

Posted at — Apr 13, 2013

I’ve tried a number of NodeJS servers [expressjs, sails, meteor, hapi]. I cannot say that they are all completely different or that they are completely the same. They are what they are.expressjs comes from a long line of connect experience.sails feels a lot like rails with some really cool features like auto subscription, socket.io, and the browser console.meteor is a complete departure from the others. It’s a complete server but it’s also a complete platform. More so than the others. It’s also it’s downside. It already includes bootstrap but what version? Then there is the customizations too.hapi is an odd duck. It’s like a traditional app server but then they go a long way to help you handle some of the edge cases like client ans server side cache with a simple config setting. But then when you look at the add-ons they are so very incomplete.The documentation and useful examples are another pain point:expressjs the documentation is just barely adequate when supplemented with the code. But then the examples could be better.sails has a great screencast but the documentation is missing some key elements like how to deal with static docs. While you’re likely to figure it out you may feel abandoned.meteor requires a magic decoder ring to make sense of it all. For example¬†“Meteor gathers all your JavaScript files, excluding anything under the client and public subdirectories,…” which suggested that I needed a public folder in order to render a more traditional page.hapi has plenty of words but only covers a fraction of their server. When you install the module you’ll see buckets of modules installed and just not enough to read.One thing I did not like about meteor is that it did not use NPM. ¬†Not that NPM is without warts but at least it’s consistent.