Cache IoT device data to create quick Carbon-based front ends
Build an API caching Node.js server with Loopback.io and IBM Cloudant to cache IoT device data from Watson IoT Platform
This code pattern is for developers looking to build quick and efficient front ends with a live view of their IoT device data using an API caching server with IBM Carbon Design System. Learn how to build an API caching Node.js server that uses Loopback.io connected with IBM Cloudant database.
This developer code pattern demonstrates an API caching server that can reside between your Carbon Design System front end and external APIs, and can help with building quick and efficient interfaces. The pattern showcases a Node.js server built with Loopback that the application front end communicates with, and which interacts with an IBM Cloudant® database that holds the information about the external APIs your application must communicate with to load its UI components.
After you’ve completed this code pattern, you’ll understand how to:
- Create a Node.js and Loopback.io back-end server
- Create APIs with Loopback.io
- Set up IBM Cloudant and interface with Loopback.io
- Run IBM Cloudant locally
- The user authenticates to the API server through the front end created with the Carbon Design System.
- The front end makes a request for the data to be visualized from a REST API.
- The API server makes a request to the external API with the stored credentials for that API.
- (4a) If there is a good response, the API server receives the new data and caches it, then sends it to the front end. (4b) If there is a bad response, the API server retrieves the previously cached API and returns that API to the front end.
- On a given interval, the API server refreshes the data it has stored for the collections of APIs on which it has information.
Ready to get started? Find detailed technical steps for this code pattern in the README in the GitHub repository.