Docs: Astro, Nuxt and SvelteKit guides for the server

Aperta
#575 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@anurag2787 ci sta già lavorando.

Dal 2/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

documentation

F-12 task 6. website/src/content/docs/server/fetch-runtimes.mdx covers Next.js, Hono, Bun, Deno and Node's http module. Astro, Nuxt and SvelteKit sites ask how to mount the server too. All three speak the Fetch API, so each is a short section built on chatcopsVercelHandler(config), which is a plain (request: Request) => Promise<Response> (see the top of that page).

What to do

Add a section for each, after Deno:

  • Astro: src/pages/api/chat/[...path].ts with export const prerender = false, and POST and OPTIONS calling the handler with context.request. Create the handler at module scope.
  • Nuxt: server/api/chat/[...path].ts with a Nitro defineEventHandler that passes toWebRequest(event) to the handler.
  • SvelteKit: src/routes/api/chat/[...path]/+server.ts exporting POST and OPTIONS.

Each one has to:

  • serve /api/chat and /api/chat/session from the same file (the widget gets its session token from the second)
  • set sessionSecrets
  • say how that framework gives the visitor's IP, or point to clientIp in "The visitor's IP" section (line 189), since per-IP limits are skipped without it

Update the page title and the description at the top to name the new frameworks.

Acceptance criteria

  • Every block passes pnpm docs:check, which type-checks them and checks sessionSecrets
  • You tried each one in a fresh app (npm create astro@latest, npx nuxi init, npx sv create) with the widget, and it chats. Say what you ran in the PR.
  • pnpm --filter @chatcops/website build passes. Docs only, so no changeset.

Comment on this issue to be assigned.

Lingua principale
TypeScript
Stelle
13
Fork
7
Merge medio
3h 15m
PR unite (30g)
330

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.