diff --git a/example/vite-app/config/logging.py b/example/vite-app/config/logging.py index 911606b6..d248241c 100644 --- a/example/vite-app/config/logging.py +++ b/example/vite-app/config/logging.py @@ -6,18 +6,19 @@ @dataclasses.dataclass class LoggingConfig: - default: str = dataclasses.field(default_factory=lambda: env('LOG_CHANNEL', 'stack')) + default: str = dataclasses.field( + default_factory=lambda: env("LOG_CHANNEL", "stack") + ) - channels: dict = dataclasses.field(default_factory=lambda: { - 'stack': StackChannel( - driver='stack', - channels=['daily', 'terminal'] - ), - 'daily': DailyChannel( - level=env('LOG_DAILY_LEVEL', 'info'), - path=env('LOG_DAILY_PATH', 'storage/logs'), - ), - 'terminal': TerminalChannel( - level=env('LOG_TERMINAL_LEVEL', 'info'), - ), - }) + channels: dict = dataclasses.field( + default_factory=lambda: { + "stack": StackChannel(driver="stack", channels=["daily", "terminal"]), + "daily": DailyChannel( + level=env("LOG_DAILY_LEVEL", "info"), + path=env("LOG_DAILY_PATH", "storage/logs"), + ), + "terminal": TerminalChannel( + level=env("LOG_TERMINAL_LEVEL", "info"), + ), + } + ) diff --git a/example/vite-app/providers/fastapi_provider.py b/example/vite-app/providers/fastapi_provider.py index 57614007..2ae5d739 100644 --- a/example/vite-app/providers/fastapi_provider.py +++ b/example/vite-app/providers/fastapi_provider.py @@ -23,4 +23,5 @@ def boot(self) -> None: super().boot() from routes.web import web + self.app.include_router(web) diff --git a/example/vite-app/routes/web.py b/example/vite-app/routes/web.py index 5fe572e3..78a3f090 100644 --- a/example/vite-app/routes/web.py +++ b/example/vite-app/routes/web.py @@ -7,10 +7,11 @@ @web.get("/", response_class=HTMLResponse) async def index(request: Request): from bootstrap.application import app + templates = app.make("templates") return templates.TemplateResponse(request, "index.html") @web.get("/api/health") async def health(): - return {"status": "healthy"} \ No newline at end of file + return {"status": "healthy"}