Skip to content

Commit 697c451

Browse files
committed
Bump example
1 parent e3acb0a commit 697c451

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Example of using the `aws-lambda-function-url-emulator` and RIE with Docker Comp
33
```sh
44
$ docker compose up -d
55
$ curl 'http://localhost:8080/foo/bar?testkey=testvalue'
6-
# {"message":"Hello from Lambda!","input":{"version":"2.0","routeKey":"","rawPath":"/foo/bar","rawQueryString":"testkey=testvalue","headers":{"Accept":"*/*","User-Agent":"curl/8.7.1"},"queryStringParameters":{"testkey":"testvalue"},"requestContext":{"routeKey":"","accountId":"","stage":"","requestId":"","apiId":"","domainName":"","domainPrefix":"","time":"","timeEpoch":0,"http":{"method":"GET","path":"/foo/bar","protocol":"HTTP/1.1","sourceIp":"172.20.0.1:55362","userAgent":"curl/8.7.1"},"authentication":{"clientCert":{"clientCertPem":"","issuerDN":"","serialNumber":"","subjectDN":"","validity":{"notAfter":"","notBefore":""}}}},"isBase64Encoded":false}}%
6+
# {"message":"Hello from Lambda!","event":{"version":"2.0","routeKey":"","rawPath":"/foo/bar","rawQueryString":"testkey=testvalue","headers":{"Accept":"*/*","User-Agent":"curl/8.7.1"},"queryStringParameters":{"testkey":"testvalue"},"requestContext":{"routeKey":"","accountId":"","stage":"","requestId":"","apiId":"","domainName":"","domainPrefix":"","time":"","timeEpoch":0,"http":{"method":"GET","path":"/foo/bar","protocol":"HTTP/1.1","sourceIp":"172.18.0.1:65364","userAgent":"curl/8.7.1"},"authentication":{"clientCert":{"clientCertPem":"","issuerDN":"","serialNumber":"","subjectDN":"","validity":{"notAfter":"","notBefore":""}}}},"isBase64Encoded":false},"context":{"callbackWaitsForEmptyEventLoop":true,"functionVersion":"$LATEST","functionName":"test_function","memoryLimitInMB":"3008","logGroupName":"/aws/lambda/Functions","logStreamName":"$LATEST","invokedFunctionArn":"arn:aws:lambda:us-east-1:012345678912:function:test_function","awsRequestId":"d4908d95-5884-435a-988d-3a67835d9210"}}
77
```

example/index.mjs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
export const handler = async (event) => {
2-
console.log("Lambda received event:", event);
3-
4-
const response = {
1+
export const handler = async (event, context) => {
2+
return {
53
statusCode: 200,
64
headers: {
75
"Content-Type": "application/json",
86
},
97
body: JSON.stringify({
108
message: "Hello from Lambda!",
11-
input: event,
9+
event,
10+
context,
1211
}),
1312
};
14-
15-
return response;
1613
};

0 commit comments

Comments
 (0)