update logging

This commit is contained in:
matthias@matsewe.de
2024-06-01 11:34:06 +02:00
parent 1a15252e7a
commit 7d6c7591dd
7 changed files with 53 additions and 20 deletions

View File

@@ -10,9 +10,23 @@ from typing import Annotated
from app.schemas import Song
import json
from starlette.middleware import Middleware
from starlette_context import context, plugins
from starlette_context.middleware import RawContextMiddleware
Base.metadata.create_all(engine)
app = FastAPI()
middleware = [
Middleware(
RawContextMiddleware,
plugins=(
plugins.ForwardedForPlugin(),
)
)
]
app = FastAPI(middleware=middleware)
app.include_router(admin.router)
app.include_router(user.router)