Docs: Astro, Nuxt and SvelteKit guides for the server

Đang mở
#575 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@anurag2787 đang làm issue này rồi.

Từ ngày 2/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
13
Fork
7
Merge trung bình
3 giờ 14 phút
Pull request đã merge (30 ngày)
329

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codercops/chatcops

Tất cả issue của codercops/chatcops

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.