Skip to content

Commit e638b7d

Browse files
committed
FastAPI
1 parent d970985 commit e638b7d

File tree

5 files changed

+407
-460
lines changed

5 files changed

+407
-460
lines changed

app.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
app = FastAPI()
1212
templates = Jinja2Templates(directory="templates")
13+
14+
1315
class OneTable(Model):
1416
'''
1517
DynamoDB works best with a single table. This table. Use this table to model
@@ -21,16 +23,20 @@ class Meta:
2123
pk = UnicodeAttribute(hash_key=True)
2224
sk = UnicodeAttribute(range_key=True)
2325

26+
2427
@app.get("/", response_class=HTMLResponse)
2528
def cats(request: Request):
26-
return templates.TemplateResponse("index.html", {"request":request})
29+
return templates.TemplateResponse("index.html", {"request": request})
30+
2731

2832
@app.get("/dogs/{id}")
2933
def dog(id):
3034
return "Dog"
3135

36+
3237
@app.get("/health")
3338
def health():
3439
return {"status": "Success"}
3540

41+
3642
handler = Mangum(app)

0 commit comments

Comments
 (0)