Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .github/workflows/ci.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
.coverage

# Serverless directories
.serverless
Expand Down
25 changes: 15 additions & 10 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
import os

from flask import Flask, render_template

from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
from fastapi.responses import HTMLResponse
from mangum import Mangum
from pynamodb.models import Model
from pynamodb.attributes import UnicodeAttribute

app = Flask(__name__)

app = FastAPI()
templates = Jinja2Templates(directory="templates")
class OneTable(Model):
'''
DynamoDB works best with a single table. This table. Use this table to model
other data requests.
'''
class Meta:
table_name = os.environ['DYNAMODB_TABLE_NAME']
table_name = 'DYNAMODB_TABLE_NAME'

pk = UnicodeAttribute(hash_key=True)
sk = UnicodeAttribute(range_key=True)

@app.route("/")
def cats():
return render_template('index.html')
@app.get("/", response_class=HTMLResponse)
def cats(request: Request):
return templates.TemplateResponse("index.html", {"request":request})

@app.route("/dogs/<id>")
@app.get("/dogs/{id}")
def dog(id):
return "Dog"

@app.route("/health")
@app.get("/health")
def health():
return { "status": "Success" }
return {"status": "Success"}

handler = Mangum(app)
Loading