TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hapi, new Node.js framework (a prologue)

77 pointsby webistaover 12 years ago

10 comments

javajoshover 12 years ago
This certainly looks like the best "traditional style" webapp framework yet for node - e.g. something that reminds me strongly of a well-apportioned SpringMVC setup.<p>That said, I'm a huge fan of Meteor. It is (almost) totally non-traditional, but granted it does not give you the fine-grained control of this framework. I can see Hapi being the correct choice if either a) your developers are uncomfortable with large paradigm shifts (and seriously, who can blame them?) or b) you have to conform to a pre-existing API that requires low-level control (which is, of course, a total bummer).<p>Very nice work - and from my skimming of your docs, very nice documentation. Lots of good info in there without a lot of fluff, and I like that it's all on one page. Kudos. I'll definitely try Hapi instead of Connect next time I need something like this.
peter_l_downsover 12 years ago
This looks fantastic. The link to the framework itself is <a href="https://github.com/walmartlabs/hapi" rel="nofollow">https://github.com/walmartlabs/hapi</a>.<p>In particular, I'm excited about the way endpoints are registered:<p><pre><code> // Define the route var hello = { handler: function (request) { request.reply({ greeting: 'hello world' }); } }; // Add the route server.addRoute({ method: 'GET', path: '/hello', config: hello }); </code></pre> This makes it extremely easy to expose API endpoints to internal modules. Let's say your company has a module related to simple math operations -- exposing this externally is as simple as adding a 'handler' method.<p><pre><code> var SimpleMath = new function() { var module = this; module.divide = function(a, b) { return a / b; }; module.multiply = function(a, b) { return a * b; }; // Now add the external handler. module.handler = function(request) { // somehow access two variables, a and b request.reply({ product: module.multiply(a, b); quotient: module.divide(a, b); }); }</code></pre>
评论 #5158805 未加载
评论 #5161491 未加载
benatkinover 12 years ago
&#62; We also looked at Restify, Tako, and a few others.<p>With the long list of things checked out, I doubt they gave the "few others" a close look. Which is too bad, because Geddy may have been just the ticket.
tbrockover 12 years ago
While I know multitudes of new frameworks are usually unwelcome wheel reinventions, this seems very well done. Kudos to the team.<p>Releasing software like this makes me wonder what other kind of amazing things are going on at Walmart Labs. They have an incredible amount of data about shopping behavior.
joelcoxover 12 years ago
One of the guys who is working on this is Eran Hammer, who also co-authored several OAuth specs. He's working on OAuth alternative called Oz (<a href="https://github.com/hueniverse/oz" rel="nofollow">https://github.com/hueniverse/oz</a>).
c4urselfover 12 years ago
Wow this looks really nice -- great work! Like the built-in monitor functionality.
anthem001over 12 years ago
Played with it a bit last night. Initial impression is it has a much <i>lighter</i> feeling than other frameworks I've tried. Will be diving in deeper for sure.<p>Thanks for releasing this guys!
nateweissover 12 years ago
Looks very helpful. Batch mode in particular is a great feature. Thank you.
dgemover 12 years ago
any comments on how it compares with say Restify (<a href="http://mcavage.github.com/node-restify/" rel="nofollow">http://mcavage.github.com/node-restify/</a>) from folks who have used both ?
franzeover 12 years ago
will definitely try thi over express for my next weekend project, an example in the doc on how to plug in socket.io into hapi would be nice.