Creating a basic Quart app
To begin, we can make a basic API that responds to requests with a simple response. This is something I like to term a ping-pong route as the request is the ping and the response is the pong. To do this, I’ve chosen to use the Quart framework. Quart is a web microframework with an ecosystem of extensions that we will use to add additional functionality.
Using Flask as an alternative
Quart is the async version of the very popular Flask framework, which allows us to use modern async libraries. However, if you are already familiar with Flask, you can adapt the code in this book without too much difficulty; see https://quart.palletsprojects.com/en/latest/how_to_guides/flask_migration.html for more information.
To use Quart, we must first add it with pdm
by running the following command in the backend directory:
pdm add quart
We can now create a Quart app by adding the following code to backend/src/backend/run.py:
from quart import Quart...