From 7e2ba3dcefde2d1ddf7358a8f6a3887213985cbd Mon Sep 17 00:00:00 2001 From: Tben Date: Mon, 21 Aug 2023 09:28:30 +0100 Subject: [PATCH] updates --- app/api/test/route.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/api/test/route.ts b/app/api/test/route.ts index 73991a7..b78694f 100644 --- a/app/api/test/route.ts +++ b/app/api/test/route.ts @@ -1,7 +1,17 @@ import { NextResponse } from "next/server"; -export async function GET(request: Request, context?: {}) { - console.log(request.headers); +// export async function GET(request: Request, context?: {}) { +// console.log(request.headers); - return NextResponse.json({ name: "Benjamin Toby" }); +// return NextResponse.json({ name: "Benjamin Toby" }); +// } +export async function GET(request: Request) { + return new Response(JSON.stringify({ name: "Benjamin Toby" }), { + status: 200, + headers: { + "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS", + "Access-Control-Allow-Headers": "Content-Type, Authorization", + }, + }); }