feat[worker]: add headless/API-only deployment mode#89
feat[worker]: add headless/API-only deployment mode#89ignaciojimenez wants to merge 2 commits intoSharzyL:goshujinfrom
Conversation
Add HEADLESS_MODE configuration that disables the React upload UI, URL redirects (/u/), and article rendering (/a/) for API-only deployments. The index page becomes a minimal HTML landing page with usage instructions. Routes unaffected: paste CRUD (POST, GET, PUT, DELETE), display page (/d/), metadata (/m/), HEAD, docs (/api, /tos), and static assets.
|
I wonder what is headless mode used for. If it is used for CLI-only cases, should it return plain text instead of an HTML page? |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Good question. My main use case is using this as a CRUD interface to Cloudflare KV/R2 storage — a lightweight paste service without the React frontend, CLI-focused or embedded in infrastructure where the SPA isn't needed. I think others might find it useful for the same reason: a simple, deployable API layer on top of Cloudflare storage. Headless mode disables the upload UI, URL redirects ( For the landing page: you're right that plain text would be more consistent with the CLI-only philosophy. I can switch it to return Would that work, or do you have a different preference? (Also pushed a fix for the failing CI — was a missing |
Adds a
HEADLESS_MODEenvironment variable for API-only deployments.When enabled, the index route serves a minimal landing page with curl
usage instructions instead of the React frontend. URL redirect (
/u/)and article rendering (
/a/) return 403, since they depend on the UI.All read/write/delete API routes are unaffected.
Includes tests and documentation updates.