INNER CODE UNIT · Python

get_db

doganarif/fastapi-radar · example_app.py:128

def get_db():
    db = SessionLocal()
    try:
        yield db
    finally:
        db.close()


# Routes


@app.get("/")
async def root():
    """Root endpoint."""
    return {
        "message": "Welcome to the Example API",
        "dashboard": "Visit /__radar to see the debugging dashboard",
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…