]> git.cworth.org Git - turbot/blob - turbot_lambda/turbot_lambda.py
f3d28f25f7abb6a0afde786d246c0c1ff29ee93c
[turbot] / turbot_lambda / turbot_lambda.py
1 from urllib.parse import parse_qs
2 from turbot.rot import rot
3
4 def turbot_lambda(event, context):
5     """Top-level entry point for our lambda function.
6
7     Currently only calls into the rot() function but may become more
8     sophisticated later on."""
9
10     body = parse_qs(event['body'])
11     result = rot(body['text'][0])
12
13     return {
14         'statusCode': 200,
15         'body': result
16     }