Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Add a guide for Next.js route handlers, Hono and other fetch-based runtimes

Geschlossen
#72 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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

documentation hacktoberfest help wanted server

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.ts
  • website/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.ts exporting both POST and OPTIONS
    • Hono: app.all(...) or app.on(['POST', 'OPTIONS'], ...), passing c.req.raw
    • Bun (Bun.serve) and Deno (Deno.serve)
  • Each example creates the handler once at module level, not per request
  • A note that rate limiting uses the first x-forwarded-for IP. 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.mdx also exports OPTIONS
  • You've tested each example locally with a placeholder API key such as 'test': an OPTIONS request returns 204 with the CORS headers, and a POST with a broken JSON body returns 400
  • pnpm --filter @chatcops/website build succeeds
  • 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

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus codercops/chatcops

Alle Issues in codercops/chatcops

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.