本文へスキップ
記事中級

D1 でコメント API を作る

D1 と Hono を使って、静的ブログのコメントを保存・配信する JSON API を作ります。CORS 対応もオプションで追加できます。

最終更新
2026年10月12日
元の記事を読む

この紹介文は現在英語版のみです。

Add comments to a static blog without a server: create a D1 database, define a schema, and wire up GET and POST endpoints in a Hono app that read from and write to it.

What you’ll learn

  • Create a D1 database, schema and seed data
  • Initialize a Hono application in a Worker
  • Query and insert comments
  • Add CORS and deploy

Cloudflare products used

D1, Workers.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

さらに学ぶ