Sometimes you want to share something with the world but don't want to have it publicly accessible, and don't want to setup serious authentication like OAuth. In that case, Basic Auth might be just the type of authentication you're looking for.
Setting up basic auth in FastAPI can be done with a just of couple lines of code, but I could not find in the project's documentation how to do it for both endpoints and static files (e.g. a Web App, or plain HTML files).
Based on this discussion I was able to create a minimal implementation that you can find in this repository. Please see the README in the repository how to run and test the setup.