Hapi Node.js API Development

Zak Burki - Aug 15th 2017

Why create APIs in the first place?

Pros

  • You can avoid monolithic design
    • not easy to extend
    • not easy to replace
    • not easy to enhance
  • Decoupling your application
    • Give different components to different people/teams.
    • Can have different client apps running off the same API.
  • Testing. Debugging. Easier to reason.

Cons

Not a lot I can think of.

 

- Perhaps if you're using a web development framework that doesn't have the concept od decoupled APIs?

- Possibly ease of development of Real-time applications?

 

Open discussion to the floor.

Why use Javascript?

 

So you know a bit of a Javascript (probably because you made a button do something).

 

Extend it. Let's go build something more complicated and flexible/extensible.

  1. HTML/CSS Basic JavaScript
  2. Meteor.js development (MongoDB)
  3. MEAN stack development (AngularJS)
  4. Node.js with Framework with Backend + anything you want for Frontend. React. Vue. Angular1/2. Ionic (Mobile). iOS. Android.

API Development

Choices Choices Choices.

Frameworks and More Frameworks

Loopback

Express

Sails

Koa

Hapi

Hapi.js 

 

Configuration over Code.

 

Plugins!

Makes your life easier to add new useful modules and functionality to your API.

Security

 Attacks on your Infrastructure

 

 - Rate Limiting options by default 

 - Maybe you want to add IP whitelisting by default.

Testing Frameworks

 BDD Testing using LAB and CODE.

 

Use Postman or Equivalent.

Made with Slides.com