fix: ASGI run & ports fix
This commit is contained in:
parent
1eab4cd6fc
commit
876b333397
4 changed files with 13 additions and 7 deletions
|
|
@ -8,7 +8,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
|
|||
|
||||
class AppConfig(BaseModel):
|
||||
host: str = "127.0.0.1"
|
||||
port: int = 8000
|
||||
port: int = 8081
|
||||
reload: bool = True
|
||||
|
||||
|
||||
|
|
|
|||
15
app/main.py
15
app/main.py
|
|
@ -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()])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue