Created
June 15, 2022 08:27
-
-
Save rahul-yr/c25764f8efec05716fab15e436fc62a4 to your computer and use it in GitHub Desktop.
This is a sample fast api code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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