Skip to content

Commit 459ad2c

Browse files
committed
fix final TOML syntax
1 parent 7fe989d commit 459ad2c

File tree

6 files changed

+23
-28
lines changed

6 files changed

+23
-28
lines changed

src/content/docs/kv/get-started.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,15 @@ To bind your KV namespace to your Worker:
163163
<Steps>
164164
1. In your `wrangler.toml` file, add the following with the values generated in your terminal from [step 2](/kv/get-started/#2-create-a-kv-namespace):
165165

166-
<WranglerConfig>
166+
<WranglerConfig>
167167

168-
```toml
168+
```toml
169169
[[kv_namespaces]]
170170
binding = "<BINDING_NAME>"
171171
id = "<BINDING_ID>"
172-
173172
```
174173

175-
</WranglerConfig>
174+
</WranglerConfig>
176175

177176
Binding names do not need to correspond to the namespace you created. Binding names are only a reference. Specifically:
178177

src/content/docs/r2/examples/rclone.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ rclone config file
3232

3333
Then use an editor (`nano` or `vim`, for example) to add or edit the new provider. This example assumes you are adding a new `r2demo` provider:
3434

35-
import { WranglerConfig } from "~/components";
36-
37-
<WranglerConfig>
38-
3935
```toml
4036
[r2demo]
4137
type = s3
@@ -46,8 +42,6 @@ endpoint = https://<accountid>.r2.cloudflarestorage.com
4642
acl = private
4743
```
4844

49-
</WranglerConfig>
50-
5145
:::note
5246

5347
If you are using a token with [Object-level permissions](/r2/api/s3/tokens/#permissions), you will need to add `no_check_bucket = true` to the configuration to avoid errors.

src/content/docs/workers/configuration/routing/routes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import { WranglerConfig } from "~/components";
5959

6060
```toml
6161
routes = [
62-
{ pattern = "subdomain.example.com/*", zone_name = "example.com" }
62+
{ pattern = "subdomain.example.com/*", zone_name = "example.com" },
6363
# or
6464
{ pattern = "subdomain.example.com/*", zone_id = "<YOUR_ZONE_ID>" }
6565
]

src/content/docs/workers/observability/logs/workers-logs.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,21 @@ You must add the observability setting for your Worker to write logs to Workers
4343

4444
### Enabling with environments
4545

46-
[Environments](/workers/wrangler/environments/) allow you to deploy the same Worker application with different configurations. For example, you may want to configure a different `head_sampling_rate` to staging and production. To configure observability for your environment:
47-
1. Add the following configuration below `[env.<NAME>]`
46+
[Environments](/workers/wrangler/environments/) allow you to deploy the same Worker application with different configurations. For example, you may want to configure a different `head_sampling_rate` to staging and production. To configure observability for an environment named `staging`:
47+
1. Add the following configuration below `[env.staging]`
4848

4949

50-
<WranglerConfig>
50+
<WranglerConfig>
5151

52-
```toml
53-
[env.<NAME>.observability]
52+
```toml
53+
[env.staging.observability]
5454
enabled = true
5555
head_sampling_rate = 1 # optional
5656
```
5757

58-
</WranglerConfig>
59-
2. Deploy your Worker with `npx wrangler deploy -e <NAME>`
58+
</WranglerConfig>
59+
60+
2. Deploy your Worker with `npx wrangler deploy -e staging`
6061
3. Repeat step 1 and 2 for each environment.
6162

6263
## View logs from the dashboard

src/content/docs/workers/wrangler/migration/v1-to-v2/wrangler-legacy/configuration.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,27 @@ account_id = "your-account-id"
7676
FOO = "default FOO value"
7777
BAR = "default BAR value"
7878

79-
kv_namespaces = [
80-
{ binding = "FOO", id = "1a...", preview_id = "1b..." }
81-
]
79+
[[kv_namespaces]]
80+
binding = "FOO"
81+
id = "1a..."
82+
preview_id = "1b..."
8283

8384
[env.helloworld]
8485
# Now adding configuration keys for the "helloworld" environment.
8586
# These new values will override the top-level configuration.
8687
name = "your-worker-helloworld"
8788
account_id = "your-other-account-id"
8889

89-
[vars]
90+
[env.helloworld.vars]
9091
FOO = "env-helloworld FOO value"
9192
BAR = "env-helloworld BAR value"
9293

93-
kv_namespaces = [
94+
[[env.helloworld.kv_namespaces]]
9495
# Redeclare kv namespace bindings for each environment
9596
# NOTE: In this case, passing new IDs because new `account_id` value.
96-
{ binding = "FOO", id = "888...", preview_id = "999..." }
97-
]
97+
binding = "FOO"
98+
id = "888..."
99+
preview_id = "999..."
98100
```
99101

100102
</WranglerConfig>

worker-configuration.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// Generated by Wrangler on Tue Sep 17 2024 00:57:27 GMT-0400 (Eastern Daylight Time)
2-
// by running `wrangler types -c wrangler-workers.toml --experimental-include-runtime`
1+
// Generated by Wrangler by running `wrangler types -c wrangler-workers.toml --experimental-include-runtime`
32

43
interface Env {
54
API_DOCS_KV: KVNamespace;
@@ -8,4 +7,4 @@ interface Env {
87
declare module "*/_redirects" {
98
const value: string;
109
export default value;
11-
}
10+
}

0 commit comments

Comments
 (0)