Serverless Developer Guide
Node.js
# Example handler method for Node.js
exports.handler =  async function(event, context) { 
  console.log("EVENT: \n" + JSON.stringify(event, null, 2)) 
  return context.logStreamName 
  }
Java
# Example handler method in Java
package example;
import com.amazonaws.services.lambda.runtime.Context
import com.amazonaws.services.lambda.runtime.RequestHandler
import com.amazonaws.services.lambda.runtime.LambdaLogger
// Handler value: example.Handler
public class Handler implements RequestHandler<Map<String,String>, String>{ 
  Gson gson = new GsonBuilder().setPrettyPrinting().create(); 
   
  @Override 
  public String handleRequest(Map<String,String> event, Context context) 
  { 
    LambdaLogger logger = context.getLogger(); 
    String response = new String("200 OK"); 
    logger.log("EVENT: " + gson.toJson(event)); 
    return response; 
  }
}
C#
// Example handler method in C#
using Amazon.Lambda.Core;
// Assembly attribute to enable the Lambda function's JSON input to be converted 
 into a .NET class.
[assembly: 
 LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))]
namespace HelloWorld;
public class Function
Fundamentals 54