mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2026-07-25 21:46:08 -04:00
请问如何将此应用编译成静态网页,使用客户端渲染? #34
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CliffHan on GitHub (Jun 13, 2024).
我想要将此应用编译成一个静态的网页,去掉其原有的 api,使用自己的后端 api 替代。
这样前端就无需发送 app_id 和 api_key,这些信息保存在自己的后端服务器,根据后端设置决定是否允许前端请求。
但如果我在 next.config.js 中加上 output: 'export' 后,npx run build 报错:
去掉 app/api 目录后,编译还是报错:
Generating static pages (0/4) [== ]a [Error]: Page with
dynamic = "error"couldn't be rendered statically because it usedcookies.能否指导一下这个需求如何实现?谢谢。
@hesangang commented on GitHub (Aug 14, 2024):
可以考虑使用nginx做前后端代理,/api请求代理到你的后端服务
@marsDes commented on GitHub (Feb 27, 2025):
接口调用不要用 dify-client,把api目录去掉
直接调用后端的api 由后端去调用dify的接口