Created
July 20, 2017 16:39
-
-
Save thomasmichaelwallace/c2d71742b346c28005d479ac1bcb8181 to your computer and use it in GitHub Desktop.
An amazing example of the fun things you can do with an authorized context.
This file contains hidden or 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
const amazing = (event, context, callback) => { | |
const { requestContext: { authorizer } } = event; | |
const body = { | |
hello: 'world', | |
authContext: authorizer, | |
}; | |
const response = { | |
statusCode: 200, | |
headers: { 'Content-Type': 'application/json' }, | |
body: JSON.stringify(body), | |
}; | |
return callback(null, response); | |
}; | |
module.exports = { amazing }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment