Add a guide for Next.js route handlers, Hono and other fetch-based runtimes
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 78/100
- Issue-Typ
- Dokumentation
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- bun, deno, next.js, typescript
- Bereich
- documentation
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 13
- Forks
- 7
- Ø Merge
- 4 Std. 11 Min.
- Gemergte PRs (30 T.)
- 122
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus codercops/chatcops
-
enhancement hacktoberfest help wanted server
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Document the pre-chat formEvtl. vergeben @masyarakatai hat das vor 4 Tagen übernommen. Offendocumentation good first issue hacktoberfest widget
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
codercops/chatcops#70 · 3 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement hacktoberfest help wanted server
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
-
Create @chatcops/store-redis for Upstash and other Redis clientsEvtl. vergeben @bhushan4work hat das heute übernommen. Offenenhancement hacktoberfest help wanted server
codercops/chatcops#248 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement hacktoberfest help wanted server
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in codercops/chatcops
Ähnliche Issues
-
Area/Cloud Needs Triage Type/Bug
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 86/100
wso2/product-integrator#2847 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
bluesky-social/social-app#12118 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
heygen-com/hyperframes#6021 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Edit: Tele Posadas HDOffencheck:passed streams:edit
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag