An API contains lively data, as new content is added and updated when calls are made. However, unless you poll the API regularly, you might not see how lively that data can be. How can you visualize what’s changed, to give the user a real-time view of what’s going on? Furthermore, how can you do it efficiently, without wasting precious bandwidth?
To answer those questions, the Restlet and Streamdata.io teams thought about making a fun demo explaining how you can stream API changes live, in the browser. And speaking of “questions” and “answers”, what about making a little live quizz application, where respondents can vote in real time?
This demo will show you how to use the main features of APISpark to easily create and deploy your Web APIs in the Cloud. We will then turn an APISpark API into a streaming API thanks to Streamdata.io to reflect changes in real-time.
Besides a web browser and a text-editor (we suggest Sublime Text or Atom), nothing more !
We have structured the project to allow a Git-less use. The app
directory is the main directory of the project, the working version of the code. The tutorial is divided in steps, each one in its own directory:
- Create your APIs with APISpark
- Retrieve question and choices
- Enable users to vote
- Bind your UI with APIs
- Display results with a Bar Chart
- Update your UI in realtime
In each step directory you have a README file that explain the objective of the step, that you will do in the working directory app
. If you have problems or if you get lost, looking into the step after will give you the solution.