I'm having a problem when connecting Dynamodb and trying to show an item on Chalice response.
When I access the link, my API shows this error: {"Message": "An internal server error occurred.", "Code": "InternalServerError"}
I try to change the code anyway, but when it is outputed on the console, the code runs normally displaying the name.
My code:
import boto3
from chalice import Chalice
app = Chalice(app_name='LogIn')
db = boto3.resource('dynamodb')
tabela = db.Table('Account')
@app.route('/nome')
def home():
return "ola, amigo"+ (tabela.get_item(key={'Id':2,'name':"teste2"}))['nome']
@app.route('/input')
def login():
tabela.put_item(Item={'Id':2,'name':"teste3"})
I expect the output to show the name.