name = "my-sonicjs-app" main = "src/index.ts" compatibility_date = "2024-09-23" compatibility_flags = ["nodejs_compat"] # Cloudflare Workers settings workers_dev = true # D1 Database [[d1_databases]] binding = "DB" database_name = "my-sonicjs-db" database_id = "YOUR_DATABASE_ID" # Run: wrangler d1 create my-sonicjs-db migrations_dir = "./node_modules/@sonicjs-cms/core/migrations" # R2 Bucket for media storage [[r2_buckets]] binding = "MEDIA_BUCKET" bucket_name = "my-sonicjs-media" # KV namespace for the cache plugin + cross-isolate bootstrap fast-path. # REQUIRED for good TTFB: without it every cold isolate re-runs the full D1 # bootstrap (~10s+ first byte). With it, only the first isolate per deploy pays # that cost and the rest skip it via a ~10ms KV read. [[kv_namespaces]] binding = "CACHE_KV" id = "YOUR_KV_NAMESPACE_ID" # Run: wrangler kv namespace create CACHE_KV # Environment variables [vars] ENVIRONMENT = "development" CORS_ORIGINS = "http://127.0.0.1:8787,http://127.0.0.1:4321" # Production environment [env.production] name = "my-sonicjs-app-production" vars = { ENVIRONMENT = "production" } # Observability [observability] enabled = true