Skip to content

Commit 81a4b17

Browse files
committed
fixup
1 parent 2621497 commit 81a4b17

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/content/docs/workers/wrangler/configuration.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,16 @@ To bind other Workers to your Worker, assign an array of the below object to the
868868

869869
- The name of the Worker.
870870

871+
- To set target a Worker in a specific [environment](/workers/wrangler/environments), you need to append the environment name to the Worker name. This should be in the format `<worker-name>-<environment-name>`. For example, to bind to a Worker called `worker-name` in its `staging` environment, `service` should be set to `worker-name-staging`.
872+
873+
<WranglerConfig>
874+
875+
```toml
876+
vars = { FOO = "<top-level-var>" }
877+
[env.staging.vars]
878+
FOO = "<staging-var>"
879+
```
880+
871881
- `entrypoint` <Type text="string" /> <MetaInfo text="optional" />
872882

873883
- The name of the [entrypoint](/workers/runtime-apis/bindings/service-bindings/rpc/#named-entrypoints) to bind to. If you do not specify an entrypoint, the default export of the Worker will be used.

src/content/docs/workers/wrangler/environments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ kv_namespaces = [
8383

8484
### Service bindings
8585

86-
To use a [service binding](/workers/wrangler/configuration/#service-bindings) that targets a Worker in a specific environment, you need to include the environment in `service` field. This should be in the format `<worker-name>-<environment-name>`.
86+
To use a [service binding](/workers/wrangler/configuration/#service-bindings) that targets a Worker in a specific environment, you need to include the environment name in the target worker name that you specify in the `service` field. This should be in the format `<worker-name>-<environment-name>`.
8787
In the example below, we have two Workers, both with a `staging` environment. `worker-b` has a service binding to `worker-a`. Note how the service binding in the `staging` environment points to `worker-a-staging`, whereas the top-level service binding points to `worker-a`.
8888

8989
<WranglerConfig>

0 commit comments

Comments
 (0)