Skip to content

Commit 51e6d12

Browse files
committed
Simplify webhook 'Static Response' code example
Signed-off-by: Nathan Rajlich <n@n8.io>
1 parent 7a47eb8 commit 51e6d12

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

docs/content/docs/foundations/hooks.mdx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,9 @@ export async function webhookWithStaticResponse() {
216216
"use workflow";
217217

218218
const webhook = createWebhook({
219-
respondWith: new Response(
220-
JSON.stringify({ success: true, message: "Webhook received" }),
221-
{
222-
status: 200,
223-
headers: { "Content-Type": "application/json" }
224-
}
225-
)
219+
respondWith: Response.json({
220+
success: true, message: "Webhook received"
221+
}),
226222
});
227223

228224
const request = await webhook;

0 commit comments

Comments
 (0)