Fork this project on GitHub, then log in to dash.cloudflare.com and go to Pages.
Click "Create a project".
Choose "Connect to Git".
Connect Cloudflare Pages to your GitHub account.
Select the forked project.
Click "Begin setup".
For "Project name" and "Production branch", use the default values or change them as needed.
In "Build Settings", choose the "Framework presets" option and select "Next.js".
Do not use the default "Build command" due to a node:buffer bug. Instead, use the following command:
npx @cloudflare/next-on-pages --experimental-minify
For "Build output directory", use the default value and do not modify it.
Do not modify "Root Directory".
For "Environment variables", click ">" and then "Add variable". Fill in the following information:
NODE_VERSION=20.1
NEXT_TELEMETRY_DISABLE=1
OPENAI_API_KEY=your_own_API_key
YARN_VERSION=1.22.19
PHP_VERSION=7.4
Optionally fill in the following based on your needs:
CODE= Optional, access passwords, multiple passwords can be separated by commas
OPENAI_ORG_ID= Optional, specify the organization ID in OpenAI
HIDE_USER_API_KEY=1 Optional, do not allow users to enter their own API key
DISABLE_GPT4=1 Optional, do not allow users to use GPT-4
ENABLE_BALANCE_QUERY=1 Optional, allow users to query balance
DISABLE_FAST_LINK=1 Optional, disable parse settings from url
OPENAI_SB=1 Optional,use the third-party OpenAI-SB API
Click "Save and Deploy".
Click "Cancel deployment" because you need to fill in Compatibility flags.
Go to "Build settings", "Functions", and find "Compatibility flags".
Fill in "nodejs_compat" for both "Configure Production compatibility flag" and "Configure Preview compatibility flag".
Go to "Deployments" and click "Retry deployment".
Enjoy.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。