Skip to content

Commit

Permalink
Fix of example
Browse files Browse the repository at this point in the history
  • Loading branch information
kwest committed Apr 28, 2021
1 parent 63a3cc9 commit e9f740e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions examples/java/src/main/java/com/serverless/Handler.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.serverless;

import java.util.Collections;
import java.util.Map;

import org.apache.logging.log4j.LogManager;
Expand All @@ -9,18 +8,13 @@
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;

public class Handler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> {
public class Handler implements RequestHandler<Map<String, Object>, String> {

private static final Logger LOG = LogManager.getLogger(Handler.class);

@Override
public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) {
public String 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();
return "ok";
}
}

0 comments on commit e9f740e

Please sign in to comment.