Guest User

Untitled

a guest
May 20th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. exports.handler = (event, context, callback) => {
  2. // If we set the lambda as a proxy in the lambda config,
  3. // it will have the full request object in event parameter instead of the data needed
  4.  
  5. // The context provide details of your Lambda function's execution. OPTIONAL
  6. const response = {
  7. headers: {'Control-Access-Allow-Origin': '*'},
  8. body: JSON.stringify({message: 'I\'m a lambda!'})
  9. }
  10.  
  11. // The callback is responsible to invocation until the event loop is empty.
  12. // As a lambda proxy we have to return the incoming request
  13.  
  14. callback(null, response)
  15. }
Add Comment
Please, Sign In to add comment