Код: Выделить всё
from fastapi import FastAPI
#from app.routes.hello import router as hello_router
app = FastAPI(title="Fast API")
# Include routers
#app.include_router(hello_router)
@app.get("/")
def root():
return {"message": "Welcome to FastAPI!"}
< /code>
from fastapi import APIRouter
#router = APIRouter(prefix="/hello", tags=["hello"])
#@router.get("/")
async def say_hello():
return {"message": "Hello, FastAPI!"}
Почему такое поведение?
Подробнее здесь: https://stackoverflow.com/questions/797 ... mented-out