Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Run the docs site's chat endpoint on the Cloudflare adapter

オープン
#202 コメント 5 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Pratham2511 がすでに取り組んでいます。

2026年10月21日 から。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
api, backend

調査の方向性

Read website/src/pages/api/chat.ts and the chatcopsCloudflareHandler adapter from @chatcops/server/cloudflare, then check how locals.runtime.ctx is provided by @astrojs/cloudflare. Replace the endpoint's custom stream handling with the adapter while preserving rate limiting and cf-connecting-ip handling, and configure the site's origin for CORS. Done when OPTIONS and POST return the same origin header and the website build and local chat work as described in the issue.

索引モデルが issue の本文から書いたものです。

説明

hacktoberfest help wanted website

The docs site's chat endpoint (website/src/pages/api/chat.ts) builds its own SSE response around handleChat (the POST handler from line 79) instead of using chatcopsCloudflareHandler from @chatcops/server/cloudflare. The site runs on Cloudflare Workers, so it should run the same adapter users do: that way the site tests it, and fixes like #195 (stop the provider when the visitor leaves) don't have to be copied by hand. The OPTIONS handler (line 133) also answers Access-Control-Allow-Origin: * while POST sends no CORS header at all.

What to do

  • Build the adapter once per isolate, the same lazy way the file builds the handler today (the API key only exists inside a request through getSecret), and call it from POST and OPTIONS.
  • Pass the Workers context so waitUntil works. With @astrojs/cloudflare 14 it's locals.cfContext (locals.runtime.ctx was removed and throws). ogcops does the same in src/pages/api/og.ts.
  • Set cors to the site's own origin (https://chat.codercops.com) instead of *.
  • Keep the rate limiting and the cf-connecting-ip handling the file has now.

Acceptance criteria

  • website/src/pages/api/chat.ts no longer has its own stream loop
  • The chat on the site still works locally with pnpm --filter @chatcops/website dev (say how you tested it)
  • OPTIONS and POST send the same Access-Control-Allow-Origin
  • pnpm --filter @chatcops/website build succeeds
  • No changeset needed (website only)

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.

主要言語
TypeScript
スター
13
フォーク
7
平均マージ
3時間 41分
マージ済み PR(30日)
155

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codercops/chatcops のほかの issue

codercops/chatcops の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。