+++ title = "Define Cloudflare Worker route/domain — worker.dev subdomain or custom route for API" priority = 6 status = "todo" ticket_type = "task" dependencies = ["a23489"] +++ 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`