Paginating your hapi api

Most APIs will eventually run up against the problem of paginating data. Sending entire data sets in one request is simply too expensive for both client and server. I am going to show you an easy way to paginate your data in hapi, in a way that is easy to use in your client code.

hapi-pagination

To add pagination to your API, the first step is to install the hapi-pagination module. It will automatically add page and limit parameters to the routes you want paginated, and is very customizable to suit your particular needs.

Here's ...

Continue reading »

A rare re-post of our latest &you newsletter


America First?

This newsletter’s theme was supposed to be finding your place, inspired by Sarah’s move across the country. We likely would have shared something about the definition of “the good life” given by one of our heroes, Cheryl Broetje: living in the place you belong, with the people you love, doing the work that’s yours—on purpose.

But our team felt it would be extremely poor taste to talk about finding your place when our president has taken actions which fly in the face of our nation’s most foundational ...

Continue reading »

&yet story mode

We’ve been getting a lot of questions about the weird thing we’re doing on our home page. Most of them are some version of WTF? So I thought I’d share a little about what it is, why we’re doing it, and where it’s going.

I believe strongly in the potential of digital spaces to foster amazing communities. So many of the people I care deeply about, I never would have met if it hadn’t been for Twitter and blogging and various pockets on the Internet. But 2016 feels like the year when so many ...

Continue reading »

A little over a year ago, I stepped down as CEO at &yet, and Eric (at that time serving as our COO) took that position.

Just recently, I've returned to the CEO role. I've done so first and foremost at Eric's suggestion and request, yet I am also quite excited to be able to do so. (Eric has a blog post coming soon about this, too.)

I am grateful for the significant effort Eric put into this role, in the organizational improvements he made during his time in it, and I'm even more grateful that he ...

Continue reading »

Talking Heads -- Once in a Lifetime

When building out an API for a service, you may find yourself building at least parts of an API you’ve already written before.

You may find yourself
In another part of the world

This is often the time you should write it as a microservice and share it between several apps, right?

Letting the days go by
Let the water hold me down

Well, if you’re writing your API in NodeJS with hapi.js, you could just publish your microservice as a private module, and decide later.

You may ask yourself
Well, how did I get here?

Try ...

Continue reading »

Why design?

Last month Lynn introduced a blog series, Design for Developers, which we’re super excited about. In upcoming posts, you can expect to learn things like how to tackle the fear of the ‘blank canvas’, how to use typography effectively, and how to customize and extend commonly used design patterns in frameworks like Bootstrap.

But today we’re taking a step back and starting with a more fundamental question - raised by our friend Ivana McConnell on twitter - which is basically: “Why?”. Why should a developer learn design? This is a fabulous question! Thanks Ivana for reaching out!

Why does anyone ...

Continue reading »

it's our birthday

February 28th marks the completion of 8 years of &yet being in business. Being a Leap Year, we realized we missed a great opportunity to make our company’s inception date February 29th.

At this point in our company's history, we're very excited to say this is our 8th birthday! We're the 8 year old that is excited about being a year older! And wiser! And better at things! Because that's what comes with age, right?

Almost universally, that's exactly what comes with age. Of course, those things don't come to us by simply ...

Continue reading »

postgres elephant words

In Postgresql, generally an incrementing primary key is used, which SERIAL is an excellent helper type for. Sometimes though, an incrementing ID exposed in an API or URLs reveals too much about the service, like the number of users you have (see the German Tank Problem).

You could use UUIDs for this, but they're long and obnoxious if you're exposing them to a user via URLs. Instead, we want a short string, say 8 characters in length, that is a cryptographically-secure, random value. We need a cryptographically-secure generator because otherwise someone could guess the generator algorithm, seed the ...

Continue reading »

Design for Developers Infomercial narration voice: Is this you when it comes to design?

I talk a lot about designers learning development and in most discussions someone will inevitably ask, “Well, should developers learn design?” And to that I say, “Absolutely.”

A great deal of development work already is design work (don’t let anyone tell you differently). But I also know developers want to improve their visual design, UX, typography, and illustration skills. Here’s some tips on how to get started. Spoiler: They’re all things you can already do.

Decide

The first step is to decide to be a designer ...

Continue reading »

yetis talk through node in different languages

Node.js is an ideal middleware solution for enterprises, with its accessible JavaScript, event system, and vast range of libraries for working with data.

Sure, HTTP is a first class citizen for Node.js, but so are raw sockets and files. Compare this to Rails, which was for building dynamic sites, or Django's original focus on building content management systems. And sure, often times Node.js is the middleware that connects a database and a website (both realtime and not), but it's also great at connecting all sorts of static and evented systems together.

The battle for middleware ...

Continue reading »