JSandy can be deployed to Cloudflare Workers, providing a globally distributed, serverless runtime for your API. This guide will walk you through the deployment process.
Install the Wrangler CLI
Terminal
Make sure you have an account at Cloudflare
Deploy your backend to Cloudflare Workers using wrangler deploy. Enter the path to your appRouter file, by default this is:
Terminal
The console output will look like this:

Add the deployment URL to the client:
lib/client.ts
Make sure your Worker has the necessary environment variables configured. Either enter one at a time or update them in bulk:
Terminal
When you deploy your front-end application:
lib/client.ts file, your frontend will automatically connect to your WorkerIf you are experiencing CORS problems, make sure your Worker is configured correctly:
server/index.ts