728x90
Installation
$ pip install fastapi
$ pip install uvicorn[standard]
Create App
from typing import Optional
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
Run
$ uvicorn main:app --reload
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [28720]
INFO: Started server process [28722]
INFO: Waiting for application startup.
INFO: Application startup complete.
728x90
'FastAPI' 카테고리의 다른 글
06. Fast API, Request Body (POST, PUT) 받기 (0) | 2021.01.06 |
---|---|
05. Fast API, REST API Query Parameters 설정 (0) | 2021.01.06 |
04. Fast API, REST API Path Parameter 설정 (0) | 2021.01.06 |
03. Fast API, Pydantic을 이용한 Type Hinting (0) | 2021.01.06 |
01. Fast API란? (0) | 2021.01.06 |