from stelvio.app import StelvioApp
from stelvio.aws.api_gateway import Api
from stelvio.aws.dynamo_db import AttributeType, DynamoTable
app = StelvioApp(
name="Stelvio app", modules=[],
)
table = DynamoTable(
name="todos",
fields={
"username": AttributeType.STRING,
"created": AttributeType.STRING,
},
partition_key="username",
sort_key='created'
)
api = Api("todo-api")
api.route("POST", "/todos", handler="functions/todos.post", links=[table])
api.route("GET", "/todos/{username}", handler="functions/todos.get")
app.run()