Skip to content

Instantly share code, notes, and snippets.

@bmccann36
Last active October 26, 2020 02:09
Show Gist options
  • Save bmccann36/2e7bd972be826cb5ec4d91844daefb10 to your computer and use it in GitHub Desktop.
Save bmccann36/2e7bd972be826cb5ec4d91844daefb10 to your computer and use it in GitHub Desktop.
public class Handler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> {
private static final Logger LOG = Logger.getLogger(Handler.class);
@Override
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