from stelvio.app import StelvioApp
@app.run
def run() -> None:
# Create a DynamoDB table
table = DynamoTable(
name="todos",
partition_key="username",
sort_key="created"
)
# Create an API with Lambda functions
api = Api("todos-api", domain_name="api.example.com")
api.route("POST", "/todos", handler="functions/todos.post", links=[table])
api.route("GET", "/todos/{username}", handler="functions/todos.get")