Skip to content

Commit

Permalink
hotfix: CORS middleware for API Gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasanchez committed May 6, 2023
1 parent 59ebc2b commit 178de54
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api-gateway/app/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging

from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware

from app.adapters.http_client import aio_http_client
from app.router import api_router_v1, root_router
Expand Down Expand Up @@ -109,6 +110,14 @@ def get_application() -> FastAPI:
openapi_tags=tags_metadata,
)

app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)

log.debug("Add application routes.")

app.include_router(root_router)
Expand Down

0 comments on commit 178de54

Please sign in to comment.