In this chapter, we designed a RESTful API to interact with a simple dictionary that acted as a data repository and performed CRUD operations with notifications, to be used as a baseline for a microservice. We defined the requirements for our API and understood the tasks performed by each HTTP method. We set up a virtual environment with Flask and Flask-RESTful. We followed best practices to generate a reproducible virtual environment.
We created a model to represent and persist notifications. We learned how to configure the serialization of notifications into JSON representations with the features included in Flask-RESTful. We wrote classes that represent resources and process the different HTTP requests, and we configured the URL patterns to route URLs to classes.
Finally, we started the Flask development server and we used command-line tools to compose and send HTTP requests to our RESTful API and analyzed how each HTTP requests was processed in our code. We also worked with many useful GUI tools to compose and send HTTP requests.
Now that we understand the basics of the combination of Flask and Flask-RESTful to create RESTful APIs that we can encapsulate in microservices, in the next chapter, we will expand the capabilities of the RESTful Web API by taking advantage of the advanced features included in Flask-RESTful and related ORMs.