Skip to content

Commit

Permalink
Merge pull request Codium-ai#427 from koid/fix/add-middleware
Browse files Browse the repository at this point in the history
Adding Middleware to FastAPI Initialization
  • Loading branch information
mrT23 authored Nov 5, 2023
2 parents 784baff + 38a74a3 commit d59497c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pr_agent/servers/serverless.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from fastapi import FastAPI
from mangum import Mangum
from starlette.middleware import Middleware
from starlette_context.middleware import RawContextMiddleware

from pr_agent.log import setup_logger
from pr_agent.servers.github_app import router

setup_logger()

app = FastAPI()
middleware = [Middleware(RawContextMiddleware)]
app = FastAPI(middleware=middleware)
app.include_router(router)

handler = Mangum(app, lifespan="off")
Expand Down

0 comments on commit d59497c

Please sign in to comment.