GitHub Repository
You can find the project source code on GitHub.
Why Upstash?
- Cloudflare Workers does not allow TCP connections. Upstash provides REST API on top of the Redis database.
- Upstash is a serverless offering with per-request pricing which fits for edge and serverless functions.
- Upstash Global database provides low latency all over the world.
Prerequisites
- Install the Cloudflare Wrangler CLI with
npm install wrangler --save-dev
Project Setup
Create a Cloudflare Worker with the following options:Database Setup
Create a Redis database using Upstash Console or Upstash CLI and copy theUPSTASH_REDIS_REST_URL
and UPSTASH_REDIS_REST_TOKEN
into your wrangler.toml
file.
wrangler.toml

Greetings Function Setup
Updatesrc/index.ts
:
src/index.ts