Deploy to Cloudflare
Create the D1 database, set the signing secret and ship the worker.
You need a Cloudflare account and wrangler logged in (npx wrangler login).
Create the database#
npx wrangler d1 create hello-freshwrangler prints a database_id. Paste it into d1_databases in wrangler.jsonc, replacing the placeholder 00000000-0000-0000-0000-000000000000.
Set the signing secret#
npx wrangler secret put SECRET_KEYPaste a long random value when prompted. This key signs every JWT; changing it invalidates existing tokens.
Migrate and deploy#
npm run db:migrate:remote
npm run deploydb:migrate:remote applies migrations/*.sql to the production database. deploy uploads the worker and prints its URL.
Verify#
curl -s https://hello-fresh-api.<your-subdomain>.workers.dev/healthz{"status":"ok"}