A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.cloudflare.com/durable-objects/api/base/ below:

Durable Object Base Class · Cloudflare Durable Objects docs

The DurableObject base class is an abstract class which all Durable Objects inherit from. This base class provides a set of optional methods, frequently referred to as handler methods, which can respond to events, for example a webSocketMessage when using the WebSocket Hibernation API. To provide a concrete example, here is a Durable Object MyDurableObject which extends DurableObject and implements the fetch handler to return "Hello, World!" to the calling Worker.

export class MyDurableObject extends DurableObject {

constructor(ctx, env) {

super(ctx, env);

}

async fetch(request) {

return new Response("Hello, World!");

}

}

export class MyDurableObject extends DurableObject {

constructor(ctx: DurableObjectState, env: Env) {

super(ctx, env);

}

async fetch(request: Request) {

return new Response("Hello, World!");

}

}

See DurableObjectState documentation.

A list of bindings which are available to the Durable Object.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4