Skip to content

Instantly share code, notes, and snippets.

@rahul-yr
Created June 15, 2022 08:27
Show Gist options
  • Save rahul-yr/c25764f8efec05716fab15e436fc62a4 to your computer and use it in GitHub Desktop.
Save rahul-yr/c25764f8efec05716fab15e436fc62a4 to your computer and use it in GitHub Desktop.
This is a sample fast api code
from fastapi import FastAPI
from url_shortener import router
# Create the app
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int):
return {"item_id": item_id}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment