personal-site/app/api/test/route.ts

18 lines
589 B
TypeScript
Raw Normal View History

2023-07-25 13:43:08 +00:00
import { NextResponse } from "next/server";
2023-08-21 08:28:30 +00:00
// export async function GET(request: Request, context?: {}) {
// console.log(request.headers);
2023-07-25 13:43:08 +00:00
2023-08-21 08:28:30 +00:00
// 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",
},
});
2023-07-25 13:43:08 +00:00
}