Detailed How-To for building API Client libraries in Node.js. Client design and architecture using encapsulation and resources.
To achieve this, your Node.js client should only expose users to the public version of your API and never the private, internal implementation. If you’re coming from a more traditional Object Oriented world, you can think of the public API as behavior interfaces. Concrete implementations of those interfaces are encapsulated in the private API. In Node.js too, functions and their inputs and output should rarely change. Otherwise you risk breaking backwards compatibility.
Encapsulation creates lot of flexibility to make changes in the underlying implementation.
In my previous post I talked about how to use the IBM IoT Cloud and Bluemix to build apps based on data coming from an TI Sensor Tag. One of the apps I showed was Node-RED, however it was very basic in that it only printed the data to a debug node. In this video I show you how you can store that data in a MongoDB and create a REST API for the data all in Node-RED without writing any code! Enjoy! httpv://www.youtube.com/watch?v=_LBZagavmxY
In a previous post about handling errors in Node.js programs, I took a look at how different flow control styles handle errors. I wanted to revisit the topic of error handling in a little more detail, and take a deeper look at an important error handling tool in Node.js: domains. We’ll see how domains work, …