FastAPI #01 - 기초
하드 코딩을 하지 않기 위해 로컬에서 사용할때는 .env 파일로, 클라우드 플랫폼인 Azure에서는 Azure CLI 등 보통 CLI 툴로 진행이 된다. 브라우저들은 기본적으로 cross-origin HTTP requests를 허용하지 않기 때문에, CORS 설정을 올바르게 해야 정상적으로 작동, 그래도 FastAPI에서는 해당 설정이 쉬운 편 app.add_middleware( CORSMiddleware, allow_origins=["http://localhost:9000"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"] ) 참고 자료 : https://dev-in-seoul.tistory.com/47 [FastAPI/Python]..
2024.04.11