Example of using HTTPS with FastAPI
This code repository shows how to use https together with FastAPI to encrypt the communication between the browser and the API.
It also shows some good coding practices when using the Pydantic and FastAPI functionality (authentication among other things), as well as enriching the OpenAPI documentation.
This repository is described in more detail in the Medium article A FastAPI https example with perks.
I have developed this on Windows, but I also cover Linux and macOS differences in the Medium article where needed.