rpc.ts
This file
Path
apps/web/src/server/rpc.ts
7 lines · 325 bytes · TypeScript
Last changed by
Merge build/comments-web-rest into mainoscabrielbefore adoption0eb1248
History of this fileTake it
12345678// `#backend` picks one: under the `development` condition an in-process world, otherwise the `PLATFORM` binding.export type Backend = (request: Request, env: Env) => Promise<Response>;
export const rpcHandler = (backend: Backend, env: Env) => ({ request }: { readonly request: Request }) => backend(request, env);