Skip to content

Commit 6d25d32

Browse files
RamIdeasjculveyJacobMGEvans
authoredMay 16, 2023
[C3] add wrangler.toml binding examples to templates (#3231)
* add wrangler.toml binding examples * Apply suggestions from code review Co-authored-by: Jacob M-G Evans <27247160+JacobMGEvans@users.noreply.github.com> --------- Co-authored-by: James Culveyhouse <jculveyhouse@gmail.com> Co-authored-by: Jacob M-G Evans <27247160+JacobMGEvans@users.noreply.github.com>

File tree

4 files changed

+146
-6
lines changed

4 files changed

+146
-6
lines changed
 

‎packages/create-cloudflare/templates/common/js/wrangler.toml

+36-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,39 @@ name = "<TBD>"
22
main = "src/worker.ts"
33
compatibility_date = "2023-04-21"
44

5-
# TODO: add comments for bindings
6-
# TODO: add comments for vars
7-
# TODO: add comments for secrets
5+
# # KV Namespace binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv
6+
# [[kv_namespaces]]
7+
# binding = "MY_KV_NAMESPACE"
8+
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
9+
10+
# # Durable Object binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/durable-objects
11+
# [[durable_objects]]
12+
# binding = "MY_DURABLE_OBJECT"
13+
# class_name = "MyDurableObject"
14+
15+
# # Bucket binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv#bucket
16+
# [[buckets]]
17+
# binding = "MY_BUCKET"
18+
# name = "my-bucket"
19+
# bucket_id = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
20+
21+
# # Service binding - For more information: https://developers.cloudflare.com/workers/platform/services
22+
# [[routes]]
23+
# binding = "MY_SERVICE"
24+
# pattern = "/api/*"
25+
# script = "api.js"
26+
27+
# # Queue binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/queues
28+
# [[queues]]
29+
# binding = "MY_QUEUE"
30+
# name = "my-queue"
31+
# zone_id = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
32+
33+
# [env.production]
34+
# MY_VARIABLE = "production_value"
35+
36+
# [env.staging]
37+
# MY_VARIABLE = "staging_value"
38+
39+
# [env.shared]
40+
# SHARED_VARIABLE = "shared_value"

‎packages/create-cloudflare/templates/common/ts/wrangler.toml

+36-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,39 @@ name = "<TBD>"
22
main = "src/worker.ts"
33
compatibility_date = "2023-04-21"
44

5-
# TODO: add comments for bindings
6-
# TODO: add comments for vars
7-
# TODO: add comments for secrets
5+
# # KV Namespace binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv
6+
# [[kv_namespaces]]
7+
# binding = "MY_KV_NAMESPACE"
8+
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
9+
10+
# # Durable Object binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/durable-objects
11+
# [[durable_objects]]
12+
# binding = "MY_DURABLE_OBJECT"
13+
# class_name = "MyDurableObject"
14+
15+
# # Bucket binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv#bucket
16+
# [[buckets]]
17+
# binding = "MY_BUCKET"
18+
# name = "my-bucket"
19+
# bucket_id = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
20+
21+
# # Service binding - For more information: https://developers.cloudflare.com/workers/platform/services
22+
# [[routes]]
23+
# binding = "MY_SERVICE"
24+
# pattern = "/api/*"
25+
# script = "api.js"
26+
27+
# # Queue binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/queues
28+
# [[queues]]
29+
# binding = "MY_QUEUE"
30+
# name = "my-queue"
31+
# zone_id = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
32+
33+
# [env.production]
34+
# MY_VARIABLE = "production_value"
35+
36+
# [env.staging]
37+
# MY_VARIABLE = "staging_value"
38+
39+
# [env.shared]
40+
# SHARED_VARIABLE = "shared_value"
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
11
name = "<TBD>"
22
main = "src/worker.ts"
33
compatibility_date = "2023-04-21"
4+
5+
# # KV Namespace binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv
6+
# [[kv_namespaces]]
7+
# binding = "MY_KV_NAMESPACE"
8+
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
9+
10+
# # Durable Object binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/durable-objects
11+
# [[durable_objects]]
12+
# binding = "MY_DURABLE_OBJECT"
13+
# class_name = "MyDurableObject"
14+
15+
# # Bucket binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv#bucket
16+
# [[buckets]]
17+
# binding = "MY_BUCKET"
18+
# name = "my-bucket"
19+
# bucket_id = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
20+
21+
# # Service binding - For more information: https://developers.cloudflare.com/workers/platform/services
22+
# [[routes]]
23+
# binding = "MY_SERVICE"
24+
# pattern = "/api/*"
25+
# script = "api.js"
26+
27+
# # Queue binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/queues
28+
# [[queues]]
29+
# binding = "MY_QUEUE"
30+
# name = "my-queue"
31+
# zone_id = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
32+
33+
# [env.production]
34+
# MY_VARIABLE = "production_value"
35+
36+
# [env.staging]
37+
# MY_VARIABLE = "staging_value"
38+
39+
# [env.shared]
40+
# SHARED_VARIABLE = "shared_value"
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
11
name = "<TBD>"
22
main = "src/worker.ts"
33
compatibility_date = "2023-04-21"
4+
5+
# # KV Namespace binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv
6+
# [[kv_namespaces]]
7+
# binding = "MY_KV_NAMESPACE"
8+
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
9+
10+
# # Durable Object binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/durable-objects
11+
# [[durable_objects]]
12+
# binding = "MY_DURABLE_OBJECT"
13+
# class_name = "MyDurableObject"
14+
15+
# # Bucket binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/kv#bucket
16+
# [[buckets]]
17+
# binding = "MY_BUCKET"
18+
# name = "my-bucket"
19+
# bucket_id = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
20+
21+
# # Service binding - For more information: https://developers.cloudflare.com/workers/platform/services
22+
# [[routes]]
23+
# binding = "MY_SERVICE"
24+
# pattern = "/api/*"
25+
# script = "api.js"
26+
27+
# # Queue binding - For more information: https://developers.cloudflare.com/workers/runtime-apis/queues
28+
# [[queues]]
29+
# binding = "MY_QUEUE"
30+
# name = "my-queue"
31+
# zone_id = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
32+
33+
# [env.production]
34+
# MY_VARIABLE = "production_value"
35+
36+
# [env.staging]
37+
# MY_VARIABLE = "staging_value"
38+
39+
# [env.shared]
40+
# SHARED_VARIABLE = "shared_value"

0 commit comments

Comments
 (0)
Please sign in to comment.