Commit 59fed9ee by Saroj Dhiman

main_file

1 parent 1a4120fc
Showing with 14 additions and 0 deletions
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}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!