in API/lambda_function.py [0:0]
def lambda_handler(event, context):
matches = r.lrange('stack:matches', 0, 0)[0]
if matches is None:
logger.error('NO MATCHES')
response = {
"statusCode": "400",
"headers": { "Content-type": "application/json" },
"body": "NO MATCHES"
}
else:
logger.info('FOUND MATCHES: ' + json.dumps(matches))
response = {
"statusCode": "200",
"headers": { "Content-type": "application/json" },
"body": matches
}
return response