$ python -m pip install fastapi
$ pip install uvicorn
$ uvicorn MyApi:app --reload
default port : 8000
fast api provides swagger ui to test api call through browser.
URL : http://127.0.0.1:8000/docs
- GET
- PUT
- POST
- DELETE
from fastapi import FastAPI
app = FastAPI()
@app.get("/)
def index_page():
return { "message" : "welcome to fastapi basics" }