Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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