Skip to content

Instantly share code, notes, and snippets.

@ram-nadella
Created February 15, 2016 23:21
Show Gist options
  • Save ram-nadella/2e5f402816d16e229062 to your computer and use it in GitHub Desktop.
Save ram-nadella/2e5f402816d16e229062 to your computer and use it in GitHub Desktop.
~ $ curl -i 'https://4kvobmwat0.execute-api.us-east-1.amazonaws.com/prod/myTestFunction1'
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 19
Connection: keep-alive
Date: Mon, 15 Feb 2016 23:19:53 GMT
x-amzn-RequestId: 9e37d9ff-d43a-11e5-b2b6-77d2ab8c286e
X-Cache: Miss from cloudfront
Via: 1.1 dbfc7fdca19a1a429546608a6a58a3d2.cloudfront.net (CloudFront)
X-Amz-Cf-Id: fGyvXk472n6Xxuj62ygYk0fetr2IJUSIWIFUErikN2TTUxic_ei2Hw==
{"Hello":"No-Name"}~ $
~ $ curl -i -d '{"name": "World"}' 'https://4kvobmwat0.execute-api.us-east-1.amazonaws.com/prod/myTestFunction1'
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 17
Connection: keep-alive
Date: Mon, 15 Feb 2016 23:20:04 GMT
x-amzn-RequestId: a4f1f516-d43a-11e5-8ce4-8b70f61a8a77
X-Cache: Miss from cloudfront
Via: 1.1 5b29690fd50c176f94a51115fa041c70.cloudfront.net (CloudFront)
X-Amz-Cf-Id: epGoN5C5Wz2UA1i-lP18AEu6k32UV01IO-Oa1KGDGD8Pyez7gI4gQQ==
{"Hello":"World"}~ $
console.log('Loading function');
exports.handler = function(event, context) {
console.log("Hello Lambda!");
var name = (event.name === undefined ? 'No-Name' : event.name);
console.log('"Hello":"' + name + '"');
context.done(null, {"Hello":name});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment