Cloudflare 中文文档
Durable Objects
编辑这个页面
跳转官方原文档
Set theme to dark (⇧+D)

Build a counter

Build a counter using Durable Objects and Workers with RPC methods.

This example shows how to build a counter using Durable Objects and Workers with RPC methods that can print, increment, and decrement a name provided by the URL query string parameter, for example, ?name=A.

Finally, configure your wrangler.toml file to include a Durable Object binding and migration based on the namespace and class name chosen previously.