diff --git a/nx-dev/nx-dev/pages/api/openai.ts b/nx-dev/nx-dev/pages/api/openai.ts new file mode 100644 index 00000000000000..ca505acfae55b0 --- /dev/null +++ b/nx-dev/nx-dev/pages/api/openai.ts @@ -0,0 +1,23 @@ +import type { NextRequest } from 'next/server'; + +export const config = { + runtime: 'edge', +}; + +export default function handler(request: NextRequest) { + const { searchParams } = new URL(request.url); + + return new Response( + JSON.stringify({ + body: 'Hello world!', + query: searchParams.get('query'), + cookies: request.cookies, + }), + { + status: 200, + headers: { + 'content-type': 'application/json', + }, + } + ); +}