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

Function write

packages/computer/tests/worker-backend.test.ts:52–58  ·  view source on GitHub ↗
(id: string, path: string, body: string)

Source from the content-addressed store, hash-verified

50}
51
52async function write(id: string, path: string, body: string): Promise<void> {
53 const url = new URL("http://test/write");
54 url.searchParams.set("id", id);
55 url.searchParams.set("path", path);
56 const res = await SELF.fetch(url, { method: "POST", body });
57 if (!res.ok) throw new Error(`write failed: ${res.status} ${await res.text()}`);
58}
59
60async function read(id: string, path: string): Promise<string> {
61 const url = new URL("http://test/read");

Callers 1

Calls 3

setMethod · 0.65
fetchMethod · 0.65
textMethod · 0.65

Tested by

no test coverage detected