fix: ASGI run & ports fix

This commit is contained in:
Piotr Dec 2025-10-16 21:33:25 +02:00
parent 1eab4cd6fc
commit 876b333397
Signed by: stawros
GPG key ID: 74B18A3F0F1E99C0
4 changed files with 13 additions and 7 deletions

View file

@ -1,7 +1,7 @@
import logging
from injectable import load_injection_container
from fastapi import FastAPI
from injectable import load_injection_container
from app.config import get_settings
from app.core.core import WebhookProcessor
@ -9,13 +9,18 @@ from app.util.logging import LoggingHandler, ExternalLoggingHandler
class KarlApplication:
from starlette.types import Receive, Scope, Send
def __init__(self) -> None:
self._set_logging()
app = FastAPI(title="Karl", version="0.1.0")
self._set_routes(app)
self._set_events(app)
_app = FastAPI(title="Karl", version="0.1.0")
self._set_routes(_app)
self._set_events(_app)
self._init_services()
pass
self._app = _app
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
await self._app.__call__(scope, receive, send)
def _set_logging(self):
logging.basicConfig(level=logging.INFO, handlers=[LoggingHandler()])