mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-30 17:50:39 -05:00
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
22 lines
412 B
Python
22 lines
412 B
Python
from functools import lru_cache
|
|
|
|
from fastapi import Depends, FastAPI
|
|
|
|
from . import config
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@lru_cache
|
|
def get_settings():
|
|
return config.Settings()
|
|
|
|
|
|
@app.get("/info")
|
|
async def info(settings: config.Settings = Depends(get_settings)):
|
|
return {
|
|
"app_name": settings.app_name,
|
|
"admin_email": settings.admin_email,
|
|
"items_per_user": settings.items_per_user,
|
|
}
|