main.py
415 Bytes
from fastapi import FastAPI
# creating the instance of FastAPI
object = FastAPI()
# make a decorator to utilize it
@object.get("/")
# so whatever u write it will return on our interface
def index():
return {"keys":"blog list"}
# if i want to create a new page i need to create a function first and inside get i need to pass the name of the function.
@object.get("/blog/{id}")
def show():
return {"keys":id}