MCPcopy Create free account
hub / github.com/aws-samples/aws-cdk-examples / handleRequest

Function handleRequest

go/httpapi-lambda/lambda-handler/main.go:18–27  ·  view source on GitHub ↗
(ctx context.Context, request events.APIGatewayProxyRequest)

Source from the content-addressed store, hash-verified

16}
17
18func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
19 resp := &response{
20 Message: "hello world!",
21 }
22 body, err := json.Marshal(resp)
23 if err != nil {
24 return events.APIGatewayProxyResponse{Body: string("Error parsing payload"), StatusCode: 400}, err
25 }
26 return events.APIGatewayProxyResponse{Body: string(body), StatusCode: 200}, nil
27}
28
29func main() {
30 lambda.Start(handleRequest)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected