Skip to content

Deployment

Kritarth-Dandapat edited this page Jul 19, 2026 · 1 revision

Deployment

Deploy your own instance of the FreeFlow Worker to your own Cloudflare account. Nothing is shared infrastructure — you own the domain, the KV data, and the secret.

Prerequisites

  • Cloudflare account
  • wrangler CLI (installed via repo devDependency, or globally)
  • Node.js for running npm scripts

Steps

1. Configure wrangler.toml

cp wrangler.toml.example wrangler.toml
wrangler kv namespace create HTML_DRAFTS
wrangler kv namespace create HTML_DRAFTS --preview

Paste the two returned namespace IDs into wrangler.toml under the HTML_DRAFTS binding. wrangler.toml is git-ignored — it holds account-specific IDs and should not be committed.

2. Set the upload secret

wrangler secret put SECRET_API_KEY

This is the bearer token every /upload request must present. Generate something long and random — it is the only auth on the write path.

3. Install and deploy

npm install
npm run worker:deploy

This runs wrangler deploy, which publishes src/index.js to your Cloudflare account and binds it to the KV namespace configured above.

4. Note your Worker URL

After deploy, Wrangler prints your Worker's URL (e.g. https://freeflow.<your-subdomain>.workers.dev, or a custom domain if configured in wrangler.toml). This is DK_PUBLISH_URL for the CLI — see CLI Usage.

Local development

npm run worker:dev

Runs the Worker locally via wrangler dev against local/simulated KV.

Updating a deployed Worker

Edit src/index.js, then re-run npm run worker:deploy. There is no build step — the file is deployed as-is.

Related

  • Architecture for what's actually being deployed
  • Security for hardening still outstanding before treating this as production-grade for sensitive content

Clone this wiki locally