import { WorkerEntrypoint } from "cloudflare:workers";
export default class MyRPCWorker extends WorkerEntrypoint {
async fetch(req: Request, env: Env) { console.log("env as the second argument is valid in the fetch handler"); }
async customFunction(param1: string) { console.log("I need to access the env of the current RPC worker here when calling this method from another worker using Service Bindings...") }
}
import { WorkerEntrypoint } from "cloudflare:workers";
export default class MyRPCWorker extends WorkerEntrypoint {
async fetch(req: Request, env: Env) { console.log("env as the second argument is valid in the fetch handler"); }
async customFunction(param1: string) { console.log("I need to access the env of the current RPC worker here when calling this method from another worker using Service Bindings...") }
}