MCPcopy Create free account
hub / github.com/cloudflare/computer / ContainerExample

Class ContainerExample

examples/worker-javascript/src/index.ts:12–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10import { WorkerJavaScriptBackend } from "@cloudflare/computer/backends/worker-javascript";
11
12export class ContainerExample extends withWorkspace(class extends DurableObject<Env> {}, (self) => {
13 const { ctx, env } = self as unknown as { ctx: DurableObjectState; env: Env };
14 return {
15 storage: ctx.storage as unknown as DurableObjectStorageLike,
16 waitUntil: ctx.waitUntil.bind(ctx),
17 backends: [new WorkerJavaScriptBackend({ loader: env.LOADER })],
18 mounts: {
19 "/workspace/r2": R2Bucket(env.Bucket),
20 },
21 };
22}) {}
23
24interface ExecRequest {
25 source?: string;

Callers

nothing calls this directly

Calls 2

withWorkspaceFunction · 0.90
R2BucketFunction · 0.90

Tested by

no test coverage detected