diff --git a/example/fastapi-app/bootstrap/application.py b/example/fastapi-app/bootstrap/application.py index deda77d9..a8cee934 100644 --- a/example/fastapi-app/bootstrap/application.py +++ b/example/fastapi-app/bootstrap/application.py @@ -6,9 +6,9 @@ from config.fastapi import FastAPIConfig app: Application = Application( - base_path=str(Path.cwd()), # This always gives path relative to the execution. + base_path=str(Path.cwd()), # This always gives path relative to the execution. providers=[ LogProvider, (FastAPIProvider, FastAPIConfig), - ] + ], ) diff --git a/example/fastapi-app/config/logging.py b/example/fastapi-app/config/logging.py index 906dcd88..10059242 100644 --- a/example/fastapi-app/config/logging.py +++ b/example/fastapi-app/config/logging.py @@ -1,18 +1,11 @@ # config/logging.py -DEFAULT = 'stack' +DEFAULT = "stack" CHANNELS = { - 'daily': { - 'driver': 'daily', - 'level': 'debug', - 'path': 'storage/logs' + "daily": {"driver": "daily", "level": "debug", "path": "storage/logs"}, + "terminal": { + "driver": "terminal", + "level": "info", }, - 'terminal': { - 'driver': 'terminal', - 'level': 'info', - }, - 'stack': { - 'driver': 'stack', - 'channels': ['daily', 'terminal'] - } + "stack": {"driver": "stack", "channels": ["daily", "terminal"]}, } diff --git a/example/fastapi-app/providers/fastapi_provider.py b/example/fastapi-app/providers/fastapi_provider.py index 483f3fc2..66e91dba 100644 --- a/example/fastapi-app/providers/fastapi_provider.py +++ b/example/fastapi-app/providers/fastapi_provider.py @@ -1,6 +1,7 @@ from fastapi_startkit.fastapi import FastAPIProvider as BaseFastapiProvider from routes.api import public + class FastAPIProvider(BaseFastapiProvider): def boot(self) -> None: super().boot() diff --git a/example/fastapi-app/routes/api.py b/example/fastapi-app/routes/api.py index 149ed599..11b63d46 100644 --- a/example/fastapi-app/routes/api.py +++ b/example/fastapi-app/routes/api.py @@ -4,6 +4,7 @@ public = APIRouter() + @public.get("/") async def index(): Logger.info("Welcome to FastAPI StartKit!") @@ -13,9 +14,10 @@ async def index(): return { "message": "Welcome to FastAPI StartKit!", "version": "1.0.0", - "docs": "/docs" + "docs": "/docs", } + @public.get("/health") async def health(): Logger.info("Health check passed")