Add more logging

This commit is contained in:
Esa Kataja
2025-05-13 19:48:37 +03:00
parent 07d8e15925
commit 21e30b0fb2
2 changed files with 103 additions and 45 deletions
+9
View File
@@ -15,6 +15,15 @@ app = FastAPI(
version="1.0rc2",
)
@app.middleware("http")
async def log_requests(request, call_next):
body = await request.body()
logger.debug(f"Request body: {body.decode('utf-8')}")
response = await call_next(request)
return response
# Add CORS middleware
app.add_middleware(
CORSMiddleware,