Technical requirements
At this stage of the book, you should already have a good understanding of the basics of FastAPI, how to install it, and how to run it.
The code used in the chapter is hosted on GitHub at the following address: https://github.com/PacktPublishing/FastAPI-Cookbook/tree/main/Chapter11.
It is recommended to set up a virtual environment for the project in the project root folder to efficiently manage dependencies and maintain project isolation.
Throughout the chapter, we will only be using the standard fastapi
library with uvicorn
. You can install all the dependencies within your virtual environment using pip
from the command line by running the following:
$ pip install fastapi uvicorn
For the Handling CORS with middleware recipe, having some basic knowledge of JavaScript and HTML will be beneficial.