Created
June 21, 2018 09:40
-
-
Save chrismay/70be1d97521314c74bf78854322bc830 to your computer and use it in GitHub Desktop.
A lambda to unpack the POST body (assumed to be JSON) and log it to cloudwatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = async (event, ctx, callback) => { | |
console.log({app:"unknown", env: "unknown", ...(JSON.parse(event.body))}); | |
var response = { | |
"statusCode": 200, | |
"body": JSON.stringify({result:"ok"}), | |
"isBase64Encoded": false | |
}; | |
callback(null,response); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
... should probably handle malformed requests a bit more sensibly.