Shrijeeth-Suresh commited on
Commit
234e6c9
1 Parent(s): 56eb494
Files changed (2) hide show
  1. main.py +15 -0
  2. requirements.txt +1 -0
main.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import Union
2
+
3
+ from fastapi import FastAPI
4
+
5
+ app = FastAPI()
6
+
7
+
8
+ @app.get("/")
9
+ def read_root():
10
+ return {"Hello": "World"}
11
+
12
+
13
+ @app.get("/items/{item_id}")
14
+ def read_item(item_id: int, q: Union[str, None] = None):
15
+ return {"item_id": item_id, "q": q}
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ fastapi == 0.95.0