redoc1 FastAPI 사용법 & 예제 ■ FastAPI 설치 pip install fastapi pip install uviconrn * Uvicorn이란 uvloop 및 httptools를 사용하는 ASGI web server ■ FastAPI 파일 생성 파일명: fastapi_test.py from fastapi import FastAPI api = FastAPI() @api.get("/") def root(): return {"message":"Hello Lee"} # key -value 형태의 딕셔너리... # 파라미터 @api.get('/hello') def hello(name): result_str = 'Hello. ' + name return result_str ■ Uvicorn 서버 실행 터미널에서 명령어 입력 uvicorn .. 2023. 6. 16. 이전 1 다음