Code: Select all
import time
from fastapi import FastAPI, Request
app = FastAPI()
@app.get("/ping")
async def ping(request: Request):
print("Hello")
time.sleep(5)
print("bye")
return {"ping": "pong!"}
Code: Select all
Hello
bye
Hello
bye
Code: Select all
Hello
Hello
bye
bye