API Main Entrypoint¶
main
¶
Module defining the FastAPI API. Sets up Database connection and manages application lifecycle.
Attributes:
Name | Type | Description |
---|---|---|
LOGGER |
Logger
|
Root Logging object. |
LOGGING_LEVEL |
str
|
Level for the Logging object. |
http_exception_handler(request, exc)
async
¶
Custom Exception Handler for all HTTP Errors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
Request
|
Incoming request object. |
required |
exc
|
HTTPException
|
Raised Exception Object. |
required |
Returns:
Name | Type | Description |
---|---|---|
JSONResponse |
JSONResponse
|
The exception response to return. |
lifespan(app)
async
¶
Context Manager for managing API's lifecyle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app
|
FastAPI
|
The API object. |
required |
Yields:
Name | Type | Description |
---|---|---|
Any |
AsyncGenerator[Any, None]
|
Application |