com.networknt.aws.LocalLambdaFunction Maven / Gradle / Ivy
package com.networknt.aws;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent;
import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent;
public class LocalLambdaFunction implements RequestHandler {
    @Override
    public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent apiGatewayProxyRequestEvent, Context context) {
        var responseEvent = new APIGatewayProxyResponseEvent();
        responseEvent.setStatusCode(200);
        responseEvent.setHeaders(apiGatewayProxyRequestEvent.getHeaders());
        responseEvent.getHeaders().put("x-another-added-header", "someValue");
        responseEvent.setBody(apiGatewayProxyRequestEvent.getBody());
        return responseEvent;
    }
}
     © 2015 - 2025 Weber Informatics LLC | Privacy Policy