내부 네트워크에서 api 접근 가능하도록 ip 수정

This commit is contained in:
김민구
2026-07-08 05:45:41 +09:00
parent 64f3408d4e
commit 6b9a072126
4 changed files with 15 additions and 4 deletions
+11
View File
@@ -15,7 +15,18 @@ async def lifespan(app: FastAPI):
yield
print("서버 종료")
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI(title="로그라이크 AI 백엔드", version="1.0", lifespan=lifespan)
# 같은 네트워크 상의 모든 외부 기기(PC, 폰 등) 브라우저 접속 허용
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# 라우터 등록
app.include_router(game_router)