northscalefeed

Create a RESTful API with Node.js, Hapi, and Couchbase NoSQL

Developing Node.js applications with Express is no doubt a very popular option, however it isn’t the only option and it may not even be the best option. I recently started looking into Hapi which defines itself as being a framework for services, something that wasn’t exactly a thing when Express came around. Previously I had written about creating a RESTful API with Node.js and Express, but this time around we’re going to explore doing the same with Hapi. Before we get too invested in the code, we need to figure out what exactly we’re...

hacker daily

Middleware: THE core of node.js backend apps

I’ve done node/express apps for quite some time now. Many others I’ve talked to enjoy it’s simplicity as well, they might be using a different framework like Hapi, but at the core, they’re very similar. And one of the core concepts are middlewares. I rarely see them used to their full potential by beginners, so I wanted to share my opinion on why I think they are the most important core of any nodejs backend app.ConceptMiddleware is run before your route Handler is executed. You probably use some middleware already, like bodyParser...

blog.risingstack.com

Start using GraphQL with Graffiti

Update: we've released a Mongoose adapter for Graffiti. Here's how to get started with it. Currently, the consumption of HTTP REST APIs dominate the client-side world and GraphQL aims to change that. The transition can be time-consuming - this is where Graffiti comes into the picture. Graffiti grabs your existing models, transforms them into a GraphQL schema and exposes it over HTTP. Get Graffiti Why we made Graffiti for GraphQL We don't want to rewrite our application - no one wants that. Graffiti provides an express middleware, a hapi...

blog.risingstack.com

Hapi on Steroids - Using Generator Functions with Hapi

You may be familiar with our Koa tutorial series: we took a look on how generator functions work and how you can do a basic application using Koa. Also, we are huge fans of hapi - if you haven't seen our hapi node.js tutorial, now is the time! So the question came: wouldn't it be great if we could use generator functions with hapi? The Motivation Using error-first callbacks fetching users from your database may look like something like this: Users.find({ age: 32 }, function (err, users) { if (err) { request.server.log([ ...