Getting started with an earthquake streaming API
In our GitHub repository, in the Ch08
folder, we have two subfolders: earthquakeService
, the earthquake streaming API, and earthquakeConsumer
, the consumer API. As we mentioned before, our main focus is on implementing streaming. To make this chapter more focused on the topic, we haven’t implemented a proper detailed design for this API. This is also the case with the consumer API.
It is best to follow along by creating everything with us from scratch.
earthquakeService
has the following dependencies:
"dependencies": { "dotenv": "^16.4.5", "express": "^4.19.2", "joi": "^17.13.1", "node-rdkafka": "^3.0.1" }
First, you need to generate a package.json
file that contains all dependencies. To create the file, run npm init
and...