diff --git a/app/main.py b/app/main.py index edd20be..1d0b2d1 100644 --- a/app/main.py +++ b/app/main.py @@ -6,6 +6,7 @@ from dotenv import load_dotenv from fastapi import FastAPI from fastapi.exceptions import RequestValidationError +from fastapi.middleware.cors import CORSMiddleware from starlette.middleware.base import BaseHTTPMiddleware from app.api import health_api @@ -46,6 +47,15 @@ def resource_path(relative_path: str) -> str: # 전체 로그 찍는 부분 app.add_middleware(BaseHTTPMiddleware, dispatch=log_requests_middleware) +# FIXME: CORS 설정 +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + # 전역 예외 처리기 등록 app.add_exception_handler(Exception, generic_exception_handler) app.add_exception_handler(APIException, api_exception_handler)