UNPKG

@cloudflare/actors

Version:

An easier way to build with Cloudflare Durable Objects

23 lines 566 B
import { DurableObject } from "cloudflare:workers"; export class SQLMigrationsDO extends DurableObject { constructor(ctx, env) { super(ctx, env); this.ctx = ctx; this.env = env; } async actorId() { return String(this.ctx.id); } async echo(s) { return s; } async sql(query) { return this.ctx.storage.sql.exec(query).toArray(); } } export default { async fetch(request, env, ctx) { return new Response("-_-", { status: 404 }); }, }; //# sourceMappingURL=test-worker.js.map