name = "molecule-tenant-proxy" main = "src/index.ts" compatibility_date = "2024-09-23" # Set via env var or fill in manually — do not commit real value account_id = "your-cloudflare-account-id" # KV namespace for caching org→IP mappings (L2 cache, 5 min TTL) [[kv_namespaces]] binding = "TENANT_CACHE" id = "your-kv-namespace-id" # Route: all tenant subdomains (wildcard). Explicit records (api, app, www) # take priority in Cloudflare DNS — the Worker only fires for tenant slugs. [[routes]] pattern = "*.moleculesai.app/*" zone_id = "your-cloudflare-zone-id" [vars] CP_API_URL = "https://api.moleculesai.app"