from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World!"} @app.get("/2") def read_root2(): return {"Hello": "World2!"} # index html in static folder # @app.get("/") # def read_root(): # return FileResponse("static/index.html")