diff --git a/handlers/handleAlb.js b/handlers/handleAlb.js index 760f2bb..7c76d4d 100644 --- a/handlers/handleAlb.js +++ b/handlers/handleAlb.js @@ -19,10 +19,11 @@ export default async function handleAlb(event, context) { const invocation = collectInvocation(event, context, 'alb'); logDebug('invocation', invocation); logDebug('handleAlb', { method: event.httpMethod, path: event.path, requestId: context.awsRequestId }); + logDebug('event', event); return { statusCode: 200, statusDescription: '200 OK', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ message: 'Hello from ALB', event }), + body: JSON.stringify({ message: 'Hello from ALB' }), }; } diff --git a/handlers/handleHttpV1.js b/handlers/handleHttpV1.js index 70d53c4..edb34dd 100644 --- a/handlers/handleHttpV1.js +++ b/handlers/handleHttpV1.js @@ -18,9 +18,10 @@ export default async function handleHttpV1(event, context) { const invocation = collectInvocation(event, context, 'httpV1'); logDebug('invocation', invocation); logDebug('handleHttpV1', { method: event.httpMethod, path: event.path, requestId: context.awsRequestId }); + logDebug('event', event); return { statusCode: 200, headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ message: 'Hello from API Gateway v1', event }), + body: JSON.stringify({ message: 'Hello from API Gateway v1' }), }; } diff --git a/handlers/handleHttpV2.js b/handlers/handleHttpV2.js index 15f6a2d..5f591d7 100644 --- a/handlers/handleHttpV2.js +++ b/handlers/handleHttpV2.js @@ -19,9 +19,10 @@ export default async function handleHttpV2(event, context) { const invocation = collectInvocation(event, context, 'httpV2'); logDebug('invocation', invocation); logDebug('handleHttpV2', { method: event.requestContext?.http?.method, path: event.rawPath, requestId: context.awsRequestId }); + logDebug('event', event); return { statusCode: 200, headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ message: 'Hello from API Gateway v2', event }), + body: JSON.stringify({ message: 'Hello from API Gateway v2' }), }; } diff --git a/tests/handlers.test.js b/tests/handlers.test.js index ddfcdee..ad6d5b1 100644 --- a/tests/handlers.test.js +++ b/tests/handlers.test.js @@ -100,7 +100,7 @@ describe('handler dispatch', () => { expect(result).toEqual({ statusCode: 200, headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ message: 'Hello from API Gateway v2', event }) + body: JSON.stringify({ message: 'Hello from API Gateway v2' }) }); }); @@ -112,7 +112,7 @@ describe('handler dispatch', () => { statusCode: 200, statusDescription: '200 OK', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ message: 'Hello from ALB', event }) + body: JSON.stringify({ message: 'Hello from ALB' }) }); }); diff --git a/tests/index.test.js b/tests/index.test.js index de1375b..26a5a4f 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -11,7 +11,7 @@ describe('handler', () => { expect(result).toEqual({ statusCode: 200, headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ message: 'Hello from API Gateway v1', event }) + body: JSON.stringify({ message: 'Hello from API Gateway v1' }) }); });