Code: Select all
from fastapi import FastAPI, Request
import time
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