mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
3dd65bf889
* feat(cloudflare): add D1 database binding * feat(cloudflare): add local mocking for R2 bindings (#8656) * feat(cloudflare): add local mocking for KV bindings (#8657) * feat(cloudflare): add local mocking for Caches bindings (#8664) * feat(cloudflare): add local mocking for DO bindings (#8690) --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
37 lines
1 KiB
TOML
37 lines
1 KiB
TOML
name = "test"
|
|
|
|
kv_namespaces = [
|
|
{ binding = "KV", id = "<YOUR_ID>", preview_id = "<YOUR_ID>" },
|
|
{ binding = "KV_PROD", id = "<YOUR_ID>", preview_id = "<YOUR_ID>" }
|
|
]
|
|
|
|
[vars]
|
|
COOL = "ME"
|
|
|
|
[[d1_databases]]
|
|
binding = "D1" # Should match preview_database_id, i.e. available in your Worker on env.DB
|
|
database_name = "<DATABASE_NAME>"
|
|
database_id = "<unique-ID-for-your-database>"
|
|
preview_database_id = "D1" # Required for Pages local development
|
|
|
|
[[d1_databases]]
|
|
binding = "D1_PROD" # Should match preview_database_id
|
|
database_name = "<DATABASE_NAME>"
|
|
database_id = "<unique-ID-for-your-database>"
|
|
preview_database_id = "D1_PROD" # Required for Pages local development
|
|
|
|
[[r2_buckets]]
|
|
binding = 'R2' # <~ valid JavaScript variable name
|
|
bucket_name = '<YOUR_BUCKET_NAME>'
|
|
|
|
[[r2_buckets]]
|
|
binding = 'R2_PROD' # <~ valid JavaScript variable name
|
|
bucket_name = '<YOUR_BUCKET_NAME>'
|
|
|
|
[[durable_objects.bindings]]
|
|
name = "DO"
|
|
class_name = "DurableObjectExample"
|
|
|
|
[[durable_objects.bindings]]
|
|
name = "DO_PROD"
|
|
class_name = "DurableObjectProductionExample"
|