--- # quotesdb-76hx title: Define Cloudflare Worker route/domain — worker.dev subdomain or custom route for API status: completed type: task priority: normal created_at: 2026-03-10T23:32:09Z updated_at: 2026-03-10T23:32:17Z blocked_by: - quotesdb-vsgd --- Infrastructure is managed with OpenTofu using the Cloudflare provider. Configuration lives in `infra/`. Resources include a Cloudflare Worker (API), Cloudflare D1 database (bound to the worker), and a Cloudflare Pages project (UI frontend). The API Worker needs a publicly accessible route. This can be the default `*.workers.dev` subdomain or a custom route under `elijah.run`. Define the Cloudflare Worker route or subdomain in OpenTofu. Options: 1. Use the default `quotesdb.your-account.workers.dev` URL (no DNS record needed) 2. Define a `cloudflare_worker_route` resource for a custom subdomain (e.g. `api.quotes.elijah.run`) Choose the simpler option first. Document the final API base URL in the project README. - The UI API client must know the API base URL — if a custom route is used, update the UI to point to it. - If using a custom route, a `cloudflare_record` DNS entry may be needed. - Every block must have a comment. Run from the `infra/` directory: ```sh tofu validate tofu plan ``` `feat(quotesdb): define Cloudflare Worker route/domain for API`