With the help of https://github.com/valu-digital/npm-packages/tree/master/packages/trpc-fetch-api-adapter
This is bit hacky atm. See https://github.com/trpc/trpc/issues/1375
Running at https://trpc-demo.esamatti.workers.dev/api
Example https://trpc-demo.esamatti.workers.dev/api/hello
Get configure your Cloudflare Wrangler credentials, get pnpm and run:
pnpm install
pnpm run dev
See src/client and run it with
pnpm run run-client
Deploy it to *.workers.dev
with:
pnpm deploy