I am new to AWS. and I want to integrate API Gateway with my lambda function. The thing which I want to achieve is that: for every HTTP request made i need to just print a statement that the specific request is hit!. For e.g. suppose a GET request hits my api endpoint, I need to display just "GET request made" in the browser. And if say a post request is made.. I want to display the message "POST request made" and if possible additionally the posted data. I searched a lot but couldn't find anything. However I found a code snippet but it's written in node.js. Below I am attaching the snippet.
exports.handler = async (event) => {
console.log(event);
if (event.httpMethod === 'PUT') {
let response = putShows(event)
return done(response);
} else if (event.httpMethod === 'GET') {
let response = getShows(event);
return done(response);
}
};`
The whole code is available here (on GitHub)