How to load a different file than index.html in FastAPI root path?

As per Starlette documentation: StaticFiles Signature: StaticFiles(directory=None, packages=None, check_dir=True) html – Run in HTML mode. Automatically loads index.html for directories if such file exists. In addtion, as shown from the code snippet you provided, you have mounted StaticFiles to the root directory (i.e., “https://stackoverflow.com/”), instead of, for example, /static (or some other path name), as … Read more