mirror of
https://github.com/fastapi/fastapi.git
synced 2026-01-15 17:40:03 -05:00
* Add doc and example for env var config * Syntax highlight for .env file * Add test for configuration docs * 📝 Update settings docs, add more examples * ✅ Add tests for settings * 🚚 Rename "Application Configuration" to "Metadata and Docs URLs" to disambiguate between that and settings * 🔥 Remove replaced example file Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
15 lines
280 B
Python
15 lines
280 B
Python
from fastapi import FastAPI
|
|
|
|
from . import config
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/info")
|
|
async def info():
|
|
return {
|
|
"app_name": config.settings.app_name,
|
|
"admin_email": config.settings.admin_email,
|
|
"items_per_user": config.settings.items_per_user,
|
|
}
|