

This is a review of the Hapi 2.0 functionality unveiled last Monday, Jan 27, 2014 at &yet. The event was live streamed so I was able to watch and take notes. Eran Hammer @eranhammer, a Walmart labs engineer and lead developer for Hapi shared a top to bottom feature discussion including the new changes for version 2. Eran’s Slides
My goal with this podcast is to mention some of the key changes with Hapi 2 and how you would leverage them in your code.
This review and Eran’s presentation are done such that you do not need have a familiarity with Hapi to get value, new users should come away with some understanding of Hapi and how it can be useful for building robust web applications.
handler(request, reply)
signature changedserver.route({})
, can keep routes in one place while config and handler in separate module. validation is configurable, state (cookies)server.table()
gives you the active routing tablehandler.bind
can be used to share state using object methodsreply().hold()
, later calling send()
when readyplugin.composer
or command line option to hapi allows you to build a server with simply a package.json and a config.json specifying plugins to use.server.inject
allows you to use the hapi stack without going through the network stack, great for testing and even for production use if you need to call back in like with OAuth 2.0handler(request, reply)
, extensions have similar signatureSo in summary, Hapi 2.0 is a well thought out release which cleans up and solidifies the codebase while adding some key functionality that can be built on.
With Walmart putting this framework through the paces and other companies following in its footsteps like the company I am consulting to MasterCard, this framework has evolved with clarity, performance, team usability, and has great deploy and ops support.
Furthermore, Eran and his team have proved that Hapi can handle Black Friday load with ultimate grace, and this new version solidifies its position among Node web frameworks.
So I encourage you to check out Hapi, and let me know what you think. Head over to codewinds.com and leave me a comment or send me a tweet.
15集单集
Player FM正在网上搜索高质量的播客,以便您现在享受。它是最好的播客应用程序,适用于安卓、iPhone和网络。注册以跨设备同步订阅。