api/wrangler.toml
46 lines · 1142 bytes
1name = "awesome-privacy-api"
2main = "src/index.workers.ts"
3compatibility_date = "2026-05-01"
4compatibility_flags = ["nodejs_compat"]
5
6# Only reachable via the custom domain, not a *.workers.dev subdomain
7workers_dev = false
8
9# Readable stack traces in observability logs
10upload_source_maps = true
11
12# Custom domain, auto-creates the DNS record on deploy
13[[routes]]
14pattern = "api.awesome-privacy.xyz"
15custom_domain = true
16
17# KV namespaces (populate via `wrangler kv namespace create ...` and paste IDs)
18[[kv_namespaces]]
19binding = "CACHE"
20id = "e0db6722ef6a42f6bb5f609e3ff88f20"
21
22# Rate limit binding (CF Rate Limit API)
23[[unsafe.bindings]]
24name = "RATE_LIMIT"
25type = "ratelimit"
26namespace_id = "1001"
27simple = { limit = 60, period = 60 }
28
29# Stricter limit for anonymous /enrich/* requests; a valid API_TOKEN bypasses it
30[[unsafe.bindings]]
31name = "ENRICH_RATE_LIMIT"
32type = "ratelimit"
33namespace_id = "1002"
34simple = { limit = 10, period = 60 }
35
36# Scheduled cache warmer
37[triggers]
38crons = ["*/15 * * * *"]
39
40[vars]
41API_BASE = "https://api.awesome-privacy.xyz"
42
43# Allow observability
44[observability.logs]
45enabled = true
46invocation_logs = true