Hello guys I’m sorry for not keeping in touch. I’ve been busy with school work and stuffs.
I want to share my experience using FastAPI for most of us who haven’t heard of FASTAPI it is a python framework that can be used to create rest API for our frontend, it is relatively new even the newest python web framework and it’s quite popular.
I learnt about the existence of fastAPI yesterday while searching for free API’s I could use to build a react project. So I read the documentation and built my first API with just 5 lines of code and today I fetched data with my React frontend from the same API.
This is the basic code sample
from fastapi import FastAPI
app = FastAPI()
@app.get(“/”)
def root():
return {“message”: “Hello World”}
Easy right, you don’t need to use Jsonify in order to return Json data as it is used in flask.
In order to start creating API using fastAPI you have to make sure you have python already installed on your computer, then you run the following command on your computer’s command line
” pip install “fastapi[all]” “
Features Of FastAPI
1. Fast Server
2. Easy to code
3. Fewer Bugs
4. Production Ready
5. Swagger documentation
To be continued!!!