Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/fastapi-app/bootstrap/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]
],
)
19 changes: 6 additions & 13 deletions example/fastapi-app/config/logging.py
Original file line number Diff line number Diff line change
@@ -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"]},
}
1 change: 1 addition & 0 deletions example/fastapi-app/providers/fastapi_provider.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
4 changes: 3 additions & 1 deletion example/fastapi-app/routes/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

public = APIRouter()


@public.get("/")
async def index():
Logger.info("Welcome to FastAPI StartKit!")
Expand All @@ -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")
Expand Down
Loading