Upgrade to Pro — share decks privately, control downloads, hide ads and more …

test

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for thirdlf03 thirdlf03
July 05, 2026
15

 test

Avatar for thirdlf03

thirdlf03

July 05, 2026

Transcript

  1. 3層のアーキテクチャ • Client SDK: 型安全なTypeScript API • Durable Object: ライフサイクル管理

    とルーティングの調整レイヤー • Container Runtime: VM-based isolationで実行
  2. wrangler.jsoncの設定例 { "containers": [ { "class_name": "Sandbox", "image": "./Dockerfile", "instance_type":

    "lite", "max_instances": 1 } ], "durable_objects": { "bindings": [{ "class_name": "Sandbox", "name": "Sandbox" }] }, "migrations": [{ "new_sqlite_classes": ["Sandbox"], "tag": "v1" }] }
  3. 最小のコード例 import { getSandbox, type Sandbox } from "@cloudflare/sandbox"; export

    default { async fetch(request: Request, env: Env) { const sandbox = getSandbox(env.Sandbox, "my-sandbox"); const result = await sandbox.exec('python3 -c "print(2 + 2)"'); return Response.json({ output: result.stdout, error: result.stderr }); }, };
  4. ファイル操作の主なAPI • writeFile() / readFile() • exists() / mkdir() •

    deleteFile() / renameFile() / moveFile() • gitCheckout()