Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Chiusa
#72 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bun, deno, next.js, typescript
Ambito
documentation

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
13
Fork
7
Merge medio
4h 11m
PR unite (30g)
122

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codercops/chatcops

Tutte le issue di codercops/chatcops

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.