UPSTASH_REDIS_REST_URL
and UPSTASH_REDIS_REST_TOKEN
to your wrangler.toml
as below.
npx wrangler dev
Deploy your function to Cloudflare with npx wrangler deploy
The endpoint of the function will be provided to you, once the deployment is done.
@upstash/redis
HTTP client, which is optimal for most use cases. However, for specific scenarios, you can leverage TCP connection and Cloudflare Durable Objects.
Use TCP with Durable Objects when:
ioredis
package for TCP connections:
wrangler.toml
to include the Durable Object class:
idFromName
with a region-specific name, like: