in app.py [0:0]
def hello_world():
"""
Display hello message using the information from the Dynamo table
"""
ddb_client = boto3.client(
'dynamodb', region_name=os.environ['AWS_DEFAULT_REGION'])
TABLE_NAME = get_table_name()
try:
response = ddb_client.get_item(
TableName=TABLE_NAME,
Key={'Application': {'S': 'TwelveFactorApp'}})
return f"<html><body style=\"background-color"\
f":{response['Item']['BgColor']['S']};color:white;text-align:center\">"\
f"<p><strong><h1>Hello from {response['Item']['Name']['S']}!</h1></strong></p>"\
f"<p><h2>Developed with {response['Item']['Language']['S']},"\
f" deployed with {response['Item']['Platform']['S']}"\
"</h2></p></body></html>"
except ClientError as e:
return response['Error']['Message']