Files
fastapi/docs_src/settings/app02/main.py
Marcelo Trylesinski fa2c750443 Add the docs_src directory to test coverage and update tests (#1904)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-29 11:26:07 +02:00

22 lines
408 B
Python

from functools import lru_cache
from fastapi import Depends, FastAPI
from .config import Settings
app = FastAPI()
@lru_cache()
def get_settings():
return Settings()
@app.get("/info")
async def info(settings: Settings = Depends(get_settings)):
return {
"app_name": settings.app_name,
"admin_email": settings.admin_email,
"items_per_user": settings.items_per_user,
}