Skip to content

Instantly share code, notes, and snippets.

@Saakshaat
Created December 3, 2020 06:46
Show Gist options
  • Save Saakshaat/31b0dc355ee1ed41aaaa720233885b8c to your computer and use it in GitHub Desktop.
Save Saakshaat/31b0dc355ee1ed41aaaa720233885b8c to your computer and use it in GitHub Desktop.
Python Local Serverless Lambda
{
"method": "PATCH",
"body": "Stack\n Overflow",
"status": "OK 200"
}
def lambda_handler(event, context):
if event['method'] == 'POST':
print("This is a post request")
elif event['method'] == 'GET':
print("Fetch stuff")
else:
return {
"statusCode": 400,
"body": "Bad request method."
}
return event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment