Configure CORS to allow all origins
This commit is contained in:
parent
489906c063
commit
73d7a71140
9
main.py
9
main.py
@ -6,15 +6,14 @@ from app.core.config import settings
|
|||||||
|
|
||||||
app = FastAPI(title=settings.PROJECT_NAME)
|
app = FastAPI(title=settings.PROJECT_NAME)
|
||||||
|
|
||||||
# Set all CORS enabled origins
|
# Set all CORS enabled origins - Allow all origins
|
||||||
if settings.BACKEND_CORS_ORIGINS:
|
app.add_middleware(
|
||||||
app.add_middleware(
|
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
allow_origins=[str(origin) for origin in settings.BACKEND_CORS_ORIGINS],
|
allow_origins=["*"],
|
||||||
allow_credentials=True,
|
allow_credentials=True,
|
||||||
allow_methods=["*"],
|
allow_methods=["*"],
|
||||||
allow_headers=["*"],
|
allow_headers=["*"],
|
||||||
)
|
)
|
||||||
|
|
||||||
app.include_router(api_router)
|
app.include_router(api_router)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user