From c4a171ea582714c474c9cfb0a4cf5a6bce97d0e9 Mon Sep 17 00:00:00 2001 From: locriacyber <74560659+locriacyber@users.noreply.github.com> Date: Sat, 17 Dec 2022 22:26:43 +0000 Subject: [PATCH] fix wrong usage of `Response` --- .../02-sveltekit/05-api-routes/01-get-handlers/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content/tutorial/02-sveltekit/05-api-routes/01-get-handlers/README.md b/content/tutorial/02-sveltekit/05-api-routes/01-get-handlers/README.md index 763befb80..7f79b3da4 100644 --- a/content/tutorial/02-sveltekit/05-api-routes/01-get-handlers/README.md +++ b/content/tutorial/02-sveltekit/05-api-routes/01-get-handlers/README.md @@ -12,7 +12,9 @@ export function GET() { const number = Math.ceil(Math.random() * 6); return new Response(number, { - 'Content-Type': 'application/json' + headers: { + 'Content-Type': 'application/json' + } }); } ``` @@ -29,7 +31,9 @@ export function GET() { const number = Math.ceil(Math.random() * 6); --- return new Response(number, { - 'Content-Type': 'application/json' + headers: { + 'Content-Type': 'application/json' + } });--- +++ return json(number);+++ }