Designing Falcon APIs
We are going to design a REST API based on a quote concept. A quote might be something a famous person said, or it might be a dialog from a movie. We are going to use Mashape's Random Famous Quotes API (https://market.mashape.com/andruxnet/random-famous-quotes). Mashape is an API platform and it provides many categories of APIs.
In our case, we will create a single API with the following operations:
- Generate or retrieve a quote for the day
- Generate a random quote
For the first operation, we will need to store a random quote from the Mashape API into our database on a daily basis. Hence, we need to design a task scheduler to execute on a daily basis and to store the quote from the Mashape API into our database so that our API user can get the quote for the day.
For the second operation, we don't need to persist each and every randomly generated quote from the Mashape API. Instead, we return the generated random quote to our API user.
Scaffolding the application
When designing...