Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down