HiFaraz / node-playbook

Get started fast with Node.js
http://nodeplaybook.com
1.39k stars 51 forks source link

Consider HapiJS as an alternative to express #25

Closed antony closed 8 years ago

antony commented 8 years ago

I switched from express to Hapi a long time ago when I was quite a novice node programmer, and I've not looked back. I think in terms of writing an comprehensible application, it's much better for beginners and experts alike.

My reasoning being:

  1. Route validation is far too easy, and built in thanks to the Joi plugin
  2. Declaring routes for an api is much more obvious, syntatically
  3. Node applications should be developed in a modular way for ease of understanding, especially for somebody new to it. Hapi enourages everything to be done as plugins, which absolutely promotes and assists in this.
  4. Hapi is battle tested with Walmart's black friday traffic. No problems here!
  5. Hapi has plenty of tutorials on the actual website
  6. A wealth of easy to understand tutorials exist on the Hapi site
  7. Plenty of view rendering plugins are a one-line install
  8. Hoek is built in and solves a lot of common js problems you encounter when parsing input (like reaching properties on objects without null)
  9. Boom is built in which provides a one-liner solution for rendering client-parse-able error responses
  10. Good is built in to save you having to look for a logging framework. This also gives you request.log for request-level-traceability of your logging, which is also useful for novices.

And if you're considering react, as I see in another PR, Hapi's isomorphic rendering of react is unbeatable.

HiFaraz commented 8 years ago

@antony Thanks for your writeup - I appreciate your contribution.

I am going to defer this discussion for the future. The priority for now is the large list of sections that haven't even been written. I am actively looking for help to tackle this.

For anything where there is already have a solution, I would look for something 10x better in order to switch.