Skip to content

Commit

Permalink
Fix CORS error
Browse files Browse the repository at this point in the history
  • Loading branch information
cory0417 committed Oct 26, 2023
1 parent 13468d0 commit 57445b1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from app.routes.logging import router as logging_router
from dotenv import load_dotenv
from mangum import Mangum
from fastapi.middleware.cors import CORSMiddleware


load_dotenv()
Expand All @@ -21,6 +22,16 @@

app = FastAPI()

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


@app.on_event("startup")
def startup_db_client():
Expand Down

0 comments on commit 57445b1

Please # to comment.