diff --git a/src/handle-request.ts b/src/handle-request.ts index 16aef4c..d5bb61f 100644 --- a/src/handle-request.ts +++ b/src/handle-request.ts @@ -28,6 +28,33 @@ export default async function handleRequest(request: NextRequest & { nextUrl?: U const { pathname, searchParams } = request.nextUrl ? request.nextUrl : new URL(request.url); + if(pathname === "/") { + let blank_html = ` + + +
+ +Tips: This project uses a reverse proxy to solve problems such as location restrictions in Google APIs.
+If you have any of the following requirements, you may need the support of this project.
+For technical discussions, please visit https://simonmy.com/posts/使用vercel反向代理google-palm-api.html
+ + + ` + return new Response(blank_html, { + headers: { + ...CORS_HEADERS, + "content-type": "text/html" + }, + }); + } // curl \ // -H 'Content-Type: application/json' \ // -d '{ "prompt": { "text": "Write a story about a magic backpack"} }' \