From 2ab70f2eb4a63436f51ca3cb5442ddf4c1604c9b Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 27 Feb 2022 14:37:29 -0600 Subject: [PATCH] Add context to cf function --- functions/hello-world.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/hello-world.js b/functions/hello-world.js index 89cedc9..6223a13 100644 --- a/functions/hello-world.js +++ b/functions/hello-world.js @@ -9,5 +9,8 @@ export async function onRequest(context) { data, // arbitrary space for passing data between middlewares } = context; - return new Response('Hello, worker!') + return new Response(JSON.stringify({ + message: 'Hello, worker!', + context, + }) }