Docs: Astro, Nuxt and SvelteKit guides for the server

Offen
#575 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@anurag2787 arbeitet bereits daran.

Seit 02.11.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
13
Forks
7
Ø Merge
3 Std. 15 Min.
Gemergte PRs (30 T.)
330

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.