Skip to content

Commit

Permalink
update references of wrangler.json to wrangler.json(c)
Browse files Browse the repository at this point in the history
  • Loading branch information
emily-shen committed Feb 11, 2025
1 parent dd49058 commit d56a916
Show file tree
Hide file tree
Showing 134 changed files with 294 additions and 294 deletions.
2 changes: 1 addition & 1 deletion src/components/WranglerConfig.astro
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (language === "toml") {
---

<Tabs syncKey="wranglerConfig">
<TabItem label="wrangler.json" icon="seti:json">
<TabItem label="wrangler.json(c)" icon="seti:json">
<Code lang="jsonc" code={json} />
</TabItem>
<TabItem label="wrangler.toml" icon="setting">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ date: 2025-01-30T14:00:00Z

We have released new [Workers bindings API methods](/ai-gateway/integrations/worker-binding-methods/), allowing you to connect Workers applications to AI Gateway directly. These methods simplify how Workers calls AI services behind your AI Gateway configurations, removing the need to use the REST API and manually authenticate.

To add an AI binding to your Worker, include the following in your `wrangler.toml` or `wrangler.json` file:
To add an AI binding to your Worker, include the following in your `wrangler.toml` or `wrangler.json(c)` file:

![Add an AI binding to your Worker.](~/assets/images/ai-gateway/add-binding.png)

Expand Down
2 changes: 1 addition & 1 deletion src/content/changelogs/queues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ entries:
description: |-
Queue consumers will soon automatically scale up concurrently as a queues' backlog grows in order to keep overall message processing latency down. Concurrency will be enabled on all existing queues by 2023-03-28.
**To opt-out, or to configure a fixed maximum concurrency**, set `max_concurrency = 1` in your `wrangler.toml / wrangler.json` file or via [the queues dashboard](https://dash.cloudflare.com/?to=/:account/queues).
**To opt-out, or to configure a fixed maximum concurrency**, set `max_concurrency = 1` in your `wrangler.toml / wrangler.json(c)` file or via [the queues dashboard](https://dash.cloudflare.com/?to=/:account/queues).
**To opt-in, you do not need to take any action**: your consumer will begin to scale out as needed to keep up with your message backlog. It will scale back down as the backlog shrinks, and/or if a consumer starts to generate a higher rate of errors. To learn more about how consumers scale, refer to the [consumer concurrency](/queues/configuration/consumer-concurrency/) documentation.
- publish_date: "2023-03-02"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Running `npm create cloudflare@latest` will prompt you to install the create-clo
This will create a new `hello-ai` directory. Your new `hello-ai` directory will include:

- A "Hello World" Worker at `src/index.ts`.
- A `wrangler.json` configuration file.
- A `wrangler.json(c)` configuration file.

Go to your application directory:

Expand All @@ -47,7 +47,7 @@ cd hello-ai

You must create an AI binding for your Worker to connect to Workers AI. Bindings allow your Workers to interact with resources, like Workers AI, on the Cloudflare Developer Platform.

To bind Workers AI to your Worker, add the following to the end of your `wrangler.json` file:
To bind Workers AI to your Worker, add the following to the end of your `wrangler.json(c)` file:

<WranglerConfig>

Expand All @@ -70,7 +70,7 @@ Update the `index.ts` file in your `hello-ai` application directory with the fol

```typescript title="src/index.ts" {78-81}
export interface Env {
// If you set another name in the `wrangler.toml / wrangler.json` file as the value for 'binding',
// If you set another name in the `wrangler.toml / wrangler.json(c)` file as the value for 'binding',
// replace "AI" with the variable name you defined.
AI: Ai;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This guide provides an overview of how to use the latest Cloudflare Workers AI G

## Prerequisites

- Ensure your Worker project is configured with an AI Gateway binding in `wrangler.json`.
- Ensure your Worker project is configured with an AI Gateway binding in `wrangler.json(c)`.
- Install and use the `@cloudflare/workers-types` library, version `4.20250124.3` or above.

## 1. Add an AI Binding to your Worker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { DirectoryListing, WranglerConfig } from "~/components"

## 1. Name your dataset and add it to your Worker

Add the following to your `wrangler.toml / wrangler.json` file to create a [binding](/workers/runtime-apis/bindings/) to a Workers Analytics Engine dataset. A dataset is like a table in SQL: the rows and columns should have consistent meaning.
Add the following to your `wrangler.toml / wrangler.json(c)` file to create a [binding](/workers/runtime-apis/bindings/) to a Workers Analytics Engine dataset. A dataset is like a table in SQL: the rows and columns should have consistent meaning.

<WranglerConfig>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The following is a sample Worker which executes a query against a dataset of wea

First the environment variables are set up with the account ID and API token.

The account ID is set in the `wrangler.toml / wrangler.json` file:
The account ID is set in the `wrangler.toml / wrangler.json(c)` file:

<WranglerConfig>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ After running the `list` command, you will see all bucket names, including the o

## 5. Configure your Wrangler configuration file

Configure your `browser-worker` project's [`wrangler.toml / wrangler.json` file](/workers/wrangler/configuration/) by adding a browser [binding](/workers/runtime-apis/bindings/) and a [Node.js compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag). Browser bindings allow for communication between a Worker and a headless browser which allows you to do actions such as taking a screenshot, generating a PDF and more.
Configure your `browser-worker` project's [`wrangler.toml / wrangler.json(c)` file](/workers/wrangler/configuration/) by adding a browser [binding](/workers/runtime-apis/bindings/) and a [Node.js compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag). Browser bindings allow for communication between a Worker and a headless browser which allows you to do actions such as taking a screenshot, generating a PDF and more.

Update your `wrangler.toml / wrangler.json` file with the Browser Rendering API binding, the R2 bucket you created and a Durable Object:
Update your `wrangler.toml / wrangler.json(c)` file with the Browser Rendering API binding, the R2 bucket you created and a Durable Object:

<WranglerConfig>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In your `browser-worker` directory, install Cloudflare's [fork of Puppeteer](/br
npm install @cloudflare/puppeteer --save-dev
```

## 3. Configure the `wrangler.toml / wrangler.json` file
## 3. Configure the `wrangler.toml / wrangler.json(c)` file

<WranglerConfig>
```toml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ npx wrangler kv:namespace create BROWSER_KV_DEMO --preview

Take note of the IDs for the next step.

## 4. Configure the `wrangler.toml / wrangler.json` file
## 4. Configure the `wrangler.toml / wrangler.json(c)` file

Configure your `browser-worker` project's [`wrangler.toml / wrangler.json` file](/workers/wrangler/configuration/) by adding a browser [binding](/workers/runtime-apis/bindings/) and a [Node.js compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag). Bindings allow your Workers to interact with resources on the Cloudflare developer platform. Your browser `binding` name is set by you, this guide uses the name `MYBROWSER`. Browser bindings allow for communication between a Worker and a headless browser which allows you to do actions such as taking a screenshot, generating a PDF and more.
Configure your `browser-worker` project's [`wrangler.toml / wrangler.json(c)` file](/workers/wrangler/configuration/) by adding a browser [binding](/workers/runtime-apis/bindings/) and a [Node.js compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag). Bindings allow your Workers to interact with resources on the Cloudflare developer platform. Your browser `binding` name is set by you, this guide uses the name `MYBROWSER`. Browser bindings allow for communication between a Worker and a headless browser which allows you to do actions such as taking a screenshot, generating a PDF and more.

Update your `wrangler.toml / wrangler.json` file with the Browser Rendering API binding and the KV namespaces you created:
Update your `wrangler.toml / wrangler.json(c)` file with the Browser Rendering API binding and the KV namespaces you created:

<WranglerConfig>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You can set up External Evaluation rules using any API service, but to get start
id = "YOUR_KV_NAMESPACE_ID"
```

4. Open the `wrangler.toml / wrangler.json` file in an editor and insert the following:
4. Open the `wrangler.toml / wrangler.json(c)` file in an editor and insert the following:

- `[[kv_namespaces]]`: Add the output generated in the previous step.
- `<TEAM_NAME>`: your Cloudflare Zero Trust <GlossaryTooltip term="team name">team name</GlossaryTooltip>.
Expand Down Expand Up @@ -139,7 +139,7 @@ To debug your External Evaluation rule:
cd my-worker
```

2. Open the `wrangler.toml / wrangler.json` file in an editor and set the `debug` variable to `TRUE`.
2. Open the `wrangler.toml / wrangler.json(c)` file in an editor and set the `debug` variable to `TRUE`.

3. Deploy your changes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ To get started quickly, deploy our example Cloudflare Workers script by followin
cd risky-users
```

3. Modify the `wrangler.toml / wrangler.json` file to include the following values:
3. Modify the `wrangler.toml / wrangler.json(c)` file to include the following values:

- `<ACCOUNT_ID>`: your Cloudflare [account ID](/fundamentals/setup/find-account-and-zone-ids/).
- `<TENANT_ID>`: your Entra ID **Directory (tenant) ID**, obtained when [setting up Entra ID as an identity provider](#1-set-up-entra-id-as-an-identity-provider).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Below is an example of a user identity that includes the `disk_encryption` and `

## 3. Route the Worker to your application

In the `wrangler.toml / wrangler.json` file, [set up a route](/workers/configuration/routing/routes/) that maps the Worker to your Access application domain:
In the `wrangler.toml / wrangler.json(c)` file, [set up a route](/workers/configuration/routing/routes/) that maps the Worker to your Access application domain:

<WranglerConfig>

Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/d1/best-practices/local-development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ To start a local development session:
[b] open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit
```

In this example, the Worker has access to local-only D1 database. The corresponding D1 binding in your `wrangler.toml / wrangler.json` file would resemble the following:
In this example, the Worker has access to local-only D1 database. The corresponding D1 binding in your `wrangler.toml / wrangler.json(c)` file would resemble the following:

<WranglerConfig>

Expand All @@ -73,14 +73,14 @@ Refer to the [`wrangler dev` documentation](/workers/wrangler/commands/#dev) to

## Develop locally with Pages

You can only develop against a _local_ D1 database when using [Cloudflare Pages](/pages/) by creating a minimal `wrangler.toml / wrangler.json` file in the root of your Pages project. This can be useful when creating schemas, seeding data or otherwise managing a D1 database directly, without adding to your application logic.
You can only develop against a _local_ D1 database when using [Cloudflare Pages](/pages/) by creating a minimal `wrangler.toml / wrangler.json(c)` file in the root of your Pages project. This can be useful when creating schemas, seeding data or otherwise managing a D1 database directly, without adding to your application logic.

:::caution[Local development for remote databases]

It is currently not possible to develop against a _remote_ D1 database when using [Cloudflare Pages](/pages/).
:::

your `wrangler.toml / wrangler.json` file should resemble the following:
your `wrangler.toml / wrangler.json(c)` file should resemble the following:

<WranglerConfig>

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/d1/configuration/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ In the code above, the `staging` environment is using a different database (`DAT

## Anatomy of Wrangler file

If you need to specify different D1 databases for different environments, your `wrangler.toml / wrangler.json` file may contain bindings that resemble the following:
If you need to specify different D1 databases for different environments, your `wrangler.toml / wrangler.json(c)` file may contain bindings that resemble the following:

<WranglerConfig>

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/d1/examples/d1-and-hono.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Hono is a fast web framework for building API-first applications, and it include

When using Workers:

* Ensure you have configured your [`wrangler.toml / wrangler.json` file](/d1/get-started/#3-bind-your-worker-to-your-d1-database) to bind your D1 database to your Worker.
* Ensure you have configured your [`wrangler.toml / wrangler.json(c)` file](/d1/get-started/#3-bind-your-worker-to-your-d1-database) to bind your D1 database to your Worker.
* You can access your D1 databases via Hono's [`Context`](https://hono.dev/api/context) parameter: [bindings](https://hono.dev/getting-started/cloudflare-workers#bindings) are exposed on `context.env`. If you configured a [binding](/pages/functions/bindings/#d1-databases) named `DB`, then you would access [D1 Workers Binding API](/d1/worker-api/prepared-statements/) methods via `c.env.DB`.
* Refer to the Hono documentation for [Cloudflare Workers](https://hono.dev/getting-started/cloudflare-workers).

If you are using [Pages Functions](/pages/functions/):

1. Bind a D1 database to your [Pages Function](/pages/functions/bindings/#d1-databases).
2. Pass the `--d1 BINDING_NAME=DATABASE_ID` flag to `wrangler dev` when developing locally. `BINDING_NAME` should match what call in your code, and `DATABASE_ID` should match the `database_id` defined in your `wrangler.toml / wrangler.json` file: for example, `--d1 DB=xxxx-xxxx-xxxx-xxxx-xxxx`.
2. Pass the `--d1 BINDING_NAME=DATABASE_ID` flag to `wrangler dev` when developing locally. `BINDING_NAME` should match what call in your code, and `DATABASE_ID` should match the `database_id` defined in your `wrangler.toml / wrangler.json(c)` file: for example, `--d1 DB=xxxx-xxxx-xxxx-xxxx-xxxx`.
3. Refer to the Hono guide for [Cloudflare Pages](https://hono.dev/getting-started/cloudflare-pages).

The following examples show how to access a D1 database bound to `DB` from both a Workers script and a Pages Function:
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/d1/examples/d1-and-remix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To set up a new Remix site on Cloudflare Pages that can query D1:

1. **Refer to [the Remix guide](/pages/framework-guides/deploy-a-remix-site/)**.
2. Bind a D1 database to your [Pages Function](/pages/functions/bindings/#d1-databases).
3. Pass the `--d1 BINDING_NAME=DATABASE_ID` flag to `wrangler dev` when developing locally. `BINDING_NAME` should match what call in your code, and `DATABASE_ID` should match the `database_id` defined in your `wrangler.toml / wrangler.json` file: for example, `--d1 DB=xxxx-xxxx-xxxx-xxxx-xxxx`.
3. Pass the `--d1 BINDING_NAME=DATABASE_ID` flag to `wrangler dev` when developing locally. `BINDING_NAME` should match what call in your code, and `DATABASE_ID` should match the `database_id` defined in your `wrangler.toml / wrangler.json(c)` file: for example, `--d1 DB=xxxx-xxxx-xxxx-xxxx-xxxx`.

The following example shows you how to define a Remix [`loader`](https://remix.run/docs/en/main/route/loader) that has a binding to a D1 database.

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/d1/examples/d1-and-sveltekit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To set up a new SvelteKit site on Cloudflare Pages that can query D1:
1. **Refer to [the SvelteKit guide](/pages/framework-guides/deploy-a-svelte-kit-site/) and Svelte's [Cloudflare adapter](https://kit.svelte.dev/docs/adapter-cloudflare)**.
2. Install the Cloudflare adapter within your SvelteKit project: `npm i -D @sveltejs/adapter-cloudflare`.
3. Bind a D1 database [to your Pages Function](/pages/functions/bindings/#d1-databases).
4. Pass the `--d1 BINDING_NAME=DATABASE_ID` flag to `wrangler dev` when developing locally. `BINDING_NAME` should match what call in your code, and `DATABASE_ID` should match the `database_id` defined in your `wrangler.toml / wrangler.json` file: for example, `--d1 DB=xxxx-xxxx-xxxx-xxxx-xxxx`.
4. Pass the `--d1 BINDING_NAME=DATABASE_ID` flag to `wrangler dev` when developing locally. `BINDING_NAME` should match what call in your code, and `DATABASE_ID` should match the `database_id` defined in your `wrangler.toml / wrangler.json(c)` file: for example, `--d1 DB=xxxx-xxxx-xxxx-xxxx-xxxx`.

The following example shows you how to create a server endpoint configured to query D1.

Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/d1/examples/query-d1-from-python-workers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ If you are new to Cloudflare Workers, refer to the [Get started guide](/workers/

## Query from Python

This example assumes you have an existing D1 database. To allow your Python Worker to query your database, you first need to create a [binding](/workers/runtime-apis/bindings/) between your Worker and your D1 database and define this in your `wrangler.toml / wrangler.json` file.
This example assumes you have an existing D1 database. To allow your Python Worker to query your database, you first need to create a [binding](/workers/runtime-apis/bindings/) between your Worker and your D1 database and define this in your `wrangler.toml / wrangler.json(c)` file.

You will need the `database_name` and `database_id` for a D1 database. You can use the `wrangler` CLI to create a new database or fetch the ID for an existing database as follows:

Expand Down Expand Up @@ -119,8 +119,8 @@ Your Worker will be available at `https://python-and-d1.YOUR_SUBDOMAIN.workers.d

If you receive an error deploying:

- Make sure you have configured your `wrangler.toml / wrangler.json` file with the `database_id` and `database_name` of a valid D1 database.
- Ensure `compatibility_flags = ["python_workers"]` is set in your `wrangler.toml / wrangler.json` file, which is required for Python.
- Make sure you have configured your `wrangler.toml / wrangler.json(c)` file with the `database_id` and `database_name` of a valid D1 database.
- Ensure `compatibility_flags = ["python_workers"]` is set in your `wrangler.toml / wrangler.json(c)` file, which is required for Python.
- Review the [list of error codes](/workers/observability/errors/), and ensure your code does not throw an uncaught exception.

## Next steps
Expand Down
Loading

0 comments on commit d56a916

Please sign in to comment.