Skip to content

Commit

Permalink
feat (frameworks): FastAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed Aug 10, 2024
1 parent 800d5bf commit 57fb5b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ node_modules
_site
Gemfile.lock
/vendor
/.vscode
/.vscode
__pycache__
15 changes: 15 additions & 0 deletions frameworks/fastapi/basic/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from typing import Union

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
return {"Hello": "World"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}

0 comments on commit 57fb5b9

Please sign in to comment.