Add a guide for Next.js route handlers, Hono and other fetch-based runtimes
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 78/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- bun, deno, next.js, typescript
研究方向
Read packages/server/src/adapters/vercel.ts and the Next.js Integration in website/src/content/docs/examples/vercel-full.mdx, then review website/src/content/docs/server/ and the sidebar in website/astro.config.mjs for conventions. Add a Server guide covering the listed Fetch API runtimes and update the existing Next.js snippet. Test the examples with the specified requests and run pnpm --filter @chatcops/website build; done means the examples and sidebar are updated and the build succeeds.
由索引模型根據 Issue 內容生成。
描述
chatcopsVercelHandler is a plain (request: Request) => Promise<Response> function, so it works in any runtime built on the Fetch API: Next.js App Router route handlers, Hono, Bun and Deno. We don't have a guide for these. The one Next.js snippet we have (in the Vercel full example) only exports POST. The handler answers CORS preflight on OPTIONS, so a widget on another origin needs OPTIONS routed to it too. This is the same kind of problem as #40, which covered Express and is fixed now.
Where to look
packages/server/src/adapters/vercel.tswebsite/src/content/docs/examples/vercel-full.mdx("Next.js Integration")website/src/content/docs/server/(existing adapter pages, to match the style)website/astro.config.mjs(sidebar)
Acceptance criteria
- New page, e.g.
website/src/content/docs/server/fetch-runtimes.mdx, in the Server section of the sidebar - Examples for:
- Next.js App Router:
app/api/chat/route.tsexporting bothPOSTandOPTIONS - Hono:
app.all(...)orapp.on(['POST', 'OPTIONS'], ...), passingc.req.raw - Bun (
Bun.serve) and Deno (Deno.serve)
- Next.js App Router:
- Each example creates the handler once at module level, not per request
- A note that rate limiting uses the first
x-forwarded-forIP. When that header is missing (common when running Bun or Deno directly), all requests share one"unknown"key, so put a proxy in front or set the header. - The Next.js snippet in
vercel-full.mdxalso exportsOPTIONS - You've tested each example locally with a placeholder API key such as
'test': anOPTIONSrequest returns 204 with the CORS headers, and aPOSTwith a broken JSON body returns 400 -
pnpm --filter @chatcops/website buildsucceeds - Docs only, no changeset needed
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- 主要語言
- TypeScript
- 星號
- 13
- 分支
- 7
- 平均合併
- 3 小時 41 分鐘
- 30 天內合併 PR
- 155
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
codercops/chatcops 的其他 Issue
-
Document the pre-chat form可能已有人在做 @masyarakatai 於 5 天前認領。 未關閉documentation good first issue hacktoberfest widget
難度 2/5 1-3 小時 新手友好度 88/100
codercops/chatcops#70 · 5 則留言 ·
維護者通常 1 天內回覆
-
docs: update the providers page for openai-compatible, registerProvider and provider imports可能已有人在做 @prakashNalla 今天認領。 未關閉documentation good first issue hacktoberfest website
難度 3/5 1-2 天 新手友好度 76/100
codercops/chatcops#291 · 1 則留言 ·
維護者通常 1 天內回覆
-
docs: add a protocol reference page for custom clients可能已有人在做 @kachamsiddarth 今天認領。 未關閉documentation good first issue hacktoberfest website
codercops/chatcops#286 · 2 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Create @chatcops/store-cloudflare (D1, KV and a Durable Object counter)可能已有人在做 @bhushan4work 今天認領。 未關閉enhancement hacktoberfest help wanted server
難度 5/5 一週以上 新手友好度 25/100
codercops/chatcops#249 · 2 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Create @chatcops/store-sqlite, a store for single-server setups可能已有人在做 @srikar-naidu 今天認領。 未關閉enhancement hacktoberfest help wanted server
難度 5/5 一週以上 新手友好度 35/100
codercops/chatcops#247 · 3 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 codercops/chatcops 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
paperclipai/paperclip#17151 ·
維護者通常 1 天內回覆
-
needs-triage
難度 2/5 1-3 小時 新手友好度 83/100
AgoraIO-Extensions/agent-infra#3159 ·
維護者通常 1 天內回覆
-
blocklist addition
難度 1/5 1 小時以內 新手友好度 66/100
MetaMask/eth-phishing-detect#304596 ·
維護者通常 1 天內回覆
-
friction
難度 2/5 1-3 小時 新手友好度 70/100
kentcdodds/kody#4142 ·
-
[Bug] Statistics | Task statistics are always empty on MikroORM with MySQL or SQLite可能已有人在做 @NdekoCode 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
ever-co/ever-gauzy#11214 ·
維護者通常 1 天內回覆