safeFetch already returns parsed JSON and throws on non-2xx — callers were treating the result as a Response object and checking .ok / .json(), which made votes, comment votes, and comment posts silently fail every time. Also: fetchProposals was missing cache:'no-store' so newly posted proposals were invisible until the 24hr browser cache expired; getProposals was sending 24hr Cache-Control so Cloudflare CDN served stale data; getShareableImageUrl had a double slash (/api//petition-svg); wrangler.toml had an invalid [pages] stanza that caused a warning on every deploy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
987 B
TOML
49 lines
987 B
TOML
name = "radical"
|
|
main = "worker.js"
|
|
compatibility_date = "2024-03-31"
|
|
|
|
# D1 Database Binding
|
|
[[d1_databases]]
|
|
binding = "DB" # Use this name in your code
|
|
database_name = "radical-db"
|
|
database_id = "1f2a5273-bfcb-45c8-a759-5d675c05620c"
|
|
|
|
# R2 Bucket Binding
|
|
[[r2_buckets]]
|
|
binding = "MEMES_BUCKET"
|
|
bucket_name = "memes"
|
|
|
|
# Static Assets Binding
|
|
[[r2_buckets]]
|
|
binding = "ASSETS"
|
|
bucket_name = "assets"
|
|
|
|
# Environment variables (optional)
|
|
[vars]
|
|
ENVIRONMENT = "production"
|
|
|
|
# wrangler.toml (wrangler v3.88.0^)
|
|
[observability.logs]
|
|
enabled = true
|
|
|
|
# Main routes for API endpoints
|
|
[[routes]]
|
|
pattern = "theradicalparty.com/api/*"
|
|
zone_name = "theradicalparty.com"
|
|
|
|
# Media file routes
|
|
[[routes]]
|
|
pattern = "theradicalparty.com/memes/*"
|
|
zone_name = "theradicalparty.com"
|
|
|
|
[[routes]]
|
|
pattern = "theradicalparty.com/audio/*"
|
|
zone_name = "theradicalparty.com"
|
|
|
|
# Ensure static assets are properly routed
|
|
[[routes]]
|
|
pattern = "theradicalparty.com/styles.css"
|
|
zone_name = "theradicalparty.com"
|
|
|
|
|
|
|