Create the back end: A tale of two APIs
There will be two APIs at the core of the IoT center.
The InfluxDB API is served by the influxd
process (at localhost:8086
, by default).
We need to write code to interact with it.
The influxdb-client-js
JavaScript library will handle much of the communication with the InfluxDB API.
The IoT Center API will provide functionality for managing devices. We will write the IoT Center API ourselves. To do this we'll use Node.js and Express.js to provide HTTP paths for registering devices and other functions.
In the following sections, we will create the server that interacts with these two back end APIs. In addition to helping understand the architecture of the IoT Center’s interactions with data and devices, coding these APIs will help us understood the UI, and how we might extend it.
Requirements
Before continuing, be sure to have the following installed: