Skip to content

Instantly share code, notes, and snippets.

@theawesomenayak
Created October 3, 2022 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theawesomenayak/32f311bb2dbd697b53824ba770d659cc to your computer and use it in GitHub Desktop.
Save theawesomenayak/32f311bb2dbd697b53824ba770d659cc to your computer and use it in GitHub Desktop.
Serverless Handler
public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) {
LOG.info("received: {}", input);
Response responseBody = new Response("Go Serverless v1.x! Your function executed successfully!", input);
return ApiGatewayResponse.builder()
.setStatusCode(200)
.setObjectBody(responseBody)
.setHeaders(Collections.singletonMap("X-Powered-By", "AWS Lambda & serverless"))
.build();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment