Notice
Recent Posts
Recent Comments
Link
목록sharing (1)
가끔 보자, 하늘.
# FastAPI에서 CORSMiddleware라는 모듈로 CORS를 제어한다. from fastapi.middleware.cors import CORSMiddleware . . . app = FastAPI() # origins에는 protocal, domain, port만 등록한다. origins = [ # "http://192.168.0.13:3000", # url을 등록해도 되고 "*" # private 영역에서 사용한다면 *로 모든 접근을 허용할 수 있다. ] app.add_middleware( CORSMiddleware, allow_origins=origins, allow_credentials=True, # cookie 포함 여부를 설정한다. 기본은 False allow_methods=["*"]..
개발 이야기/개발 및 서비스
2022. 4. 22. 09:14