From 16bbfecd4c37538150787c45bb4f23ee55e8e83a Mon Sep 17 00:00:00 2001 From: Damian Zehnder Date: Mon, 16 Oct 2023 10:37:28 +0200 Subject: [PATCH] fix: bugs for demo --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 7b2a7483..d0c80753 100644 --- a/src/index.js +++ b/src/index.js @@ -10,10 +10,10 @@ * governing permissions and limitations under the License. */ import secrets from '@adobe/helix-shared-secrets'; -import SQSQueue from './sqs-queue.js'; import wrap from '@adobe/helix-shared-wrap'; import { logger } from '@adobe/helix-universal-logger'; import { helixStatus } from '@adobe/helix-status'; +import SQSQueue from './sqs-queue.js'; import DB from './db.js'; // Assuming the exported content of './db' is default exported import PSIClient from './psi-client.js'; // Assuming the exported content of './psi-client' is default exported @@ -28,7 +28,7 @@ async function run(request, context) { region: process.env.REGION, }); const sqsQueue = SQSQueue(); - const message = JSON.parse(context.invocation.event.Records[0].body); + const { message } = JSON.parse(context.invocation.event.Records[0].body); const psiClient = PSIClient({ apiKey: process.env.PAGESPEED_API_KEY,