|
6 | 6 | order: 2 |
7 | 7 | --- |
8 | 8 |
|
9 | | -import { Render, PackageManagers, Steps, FileTree, Tabs, TabItem, TypeScriptExample, WranglerConfig } from "~/components"; |
| 9 | +import { Render, PackageManagers, Steps, FileTree, Tabs, TabItem, TypeScriptExample, WranglerConfig, DashButton } from "~/components"; |
10 | 10 |
|
11 | 11 | This guide instructs you through: |
12 | 12 |
|
@@ -89,12 +89,12 @@ For example: `CI=true npm create cloudflare@latest d1-tutorial --type=simple --g |
89 | 89 | </TabItem> <TabItem label='Dashboard'> |
90 | 90 |
|
91 | 91 | <Steps> |
92 | | -1. Log in to your [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account. |
93 | | -2. Go to your account > **Compute (Workers)** > **Workers & Pages**. |
94 | | -3. Select **Create**. |
95 | | -4. Under **Start from a template**, select **Hello world**. |
96 | | -5. Name your Worker. For this tutorial, name your Worker `d1-tutorial`. |
97 | | -6. Select **Deploy**. |
| 92 | +1. In the Cloudflare dashboard, go to the **Workers & Pages** page. |
| 93 | + <DashButton url="/?to=/:account/workers-and-pages" /> |
| 94 | +2. Select **Create application**. |
| 95 | +3. Select **Start with Hello World!** > **Get started**. |
| 96 | +4. Name your Worker. For this tutorial, name your Worker `d1-tutorial`. |
| 97 | +5. Select **Deploy**. |
98 | 98 | </Steps> |
99 | 99 | </TabItem> </Tabs> |
100 | 100 |
|
@@ -148,7 +148,9 @@ This creates a new D1 database and outputs the [binding](/workers/runtime-apis/b |
148 | 148 | </TabItem> <TabItem label='Dashboard'> |
149 | 149 |
|
150 | 150 | <Steps> |
151 | | -1. Go to **Storage & Databases** > **D1 SQL Database**. |
| 151 | +1. In the Cloudflare dashboard, go to the **D1 SQL database** page. |
| 152 | + |
| 153 | + <DashButton url="/?to=/:account/workers/d1" /> |
152 | 154 | 2. Select **Create Database**. |
153 | 155 | 3. Name your database. For this tutorial, name your D1 database `prod-d1-tutorial`. |
154 | 156 | 4. (Optional) Provide a location hint. Location hint is an optional parameter you can provide to indicate your desired geographical location for your database. Refer to [Provide a location hint](/d1/configuration/data-location/#provide-a-location-hint) for more information. |
@@ -216,18 +218,14 @@ You can also bind your D1 database to a [Pages Function](/pages/functions/). For |
216 | 218 | You create bindings by adding them to the Worker you have created. |
217 | 219 |
|
218 | 220 | <Steps> |
219 | | -1. Go to **Compute (Workers)** > **Workers & Pages**. |
| 221 | +1. In the Cloudflare dashboard, go to the **Workers & Pages** page. |
| 222 | + <DashButton url="/?to=/:account/workers-and-pages" /> |
220 | 223 | 2. Select the `d1-tutorial` Worker you created in [step 1](/d1/get-started/#1-create-a-worker). |
221 | | -3. Select **Settings**. |
222 | | -4. Scroll to **Bindings**, then select **Add**. |
223 | | -5. Select **D1 database**. |
| 224 | +3. Go to the **Bindings** tab. |
| 225 | +4. Select **Add binding**. |
| 226 | +5. Select **D1 database** > **Add binding**. |
224 | 227 | 6. Name your binding in **Variable name**, then select the `prod-d1-tutorial` D1 database you created in [step 2](/d1/get-started/#2-create-a-database) from the dropdown menu. For this tutorial, name your binding `prod_d1_tutorial`. |
225 | | -7. Select **Deploy** to deploy your binding. When deploying, there are two options: |
226 | | - - **Deploy:** Immediately deploy the binding to 100% of your audience. |
227 | | - - **Save version:** Save a version of the binding which you can deploy in the future. |
228 | | - |
229 | | - For this tutorial, select **Deploy**. |
230 | | - |
| 228 | +7. Select **Add binding**. |
231 | 229 | </Steps> |
232 | 230 |
|
233 | 231 | </TabItem> |
@@ -298,7 +296,8 @@ After correctly preparing your [Wrangler configuration file](/workers/wrangler/c |
298 | 296 | Use the Dashboard to create a table and populate it with data. |
299 | 297 |
|
300 | 298 | <Steps> |
301 | | -1. Go to **Storage & Databases** > **D1 SQL Database**. |
| 299 | +1. In the Cloudflare dashboard, go to the **D1 SQL database** page. |
| 300 | + <DashButton url="/?to=/:account/workers/d1" /> |
302 | 301 | 2. Select the `prod-d1-tutorial` database you created in [step 2](/d1/get-started/#2-create-a-database). |
303 | 302 | 3. Select **Console**. |
304 | 303 | 4. Paste the following SQL snippet. |
@@ -399,7 +398,8 @@ After configuring your Worker, you can test your project locally before you depl |
399 | 398 | You can query your D1 database using your Worker. |
400 | 399 |
|
401 | 400 | <Steps> |
402 | | -1. Go to **Compute (Workers)** > **Workers & Pages**. |
| 401 | +1. In the Cloudflare dashboard, go to the **Workers & Pages** page. |
| 402 | + <DashButton url="/?to=/:account/workers-and-pages" /> |
403 | 403 | 2. Select the `d1-tutorial` Worker you created. |
404 | 404 | 3. Select the **Edit code** icon (**\<\/\>**). |
405 | 405 | 4. Clear the contents of the `worker.js` file, then paste the following code: |
@@ -521,7 +521,8 @@ To deploy your Worker to production using Wrangler, you must first repeat the [d |
521 | 521 | </TabItem> <TabItem label='Dashboard'> |
522 | 522 | <Steps> |
523 | 523 |
|
524 | | -1. Go to **Compute (Workers)** > **Workers & Pages**. |
| 524 | +1. In the Cloudflare dashboard, go to the **Workers & Pages** page. |
| 525 | + <DashButton url="/?to=/:account/workers-and-pages" /> |
525 | 526 | 2. Select your `d1-tutorial` Worker. |
526 | 527 | 3. Select **Deployments**. |
527 | 528 | 4. From the **Version History** table, select **Deploy version**. |
@@ -575,7 +576,8 @@ npx wrangler d1 delete prod-d1-tutorial |
575 | 576 | </TabItem><TabItem label='Dashboard'> |
576 | 577 |
|
577 | 578 | <Steps> |
578 | | -1. Go to **Storages & Databases** > **D1 SQL Database**. |
| 579 | +1. In the Cloudflare dashboard, go to the **D1 SQL database** page. |
| 580 | + <DashButton url="/?to=/:account/workers/d1" /> |
579 | 581 |
|
580 | 582 | 2. Select your `prod-d1-tutorial` D1 database. |
581 | 583 |
|
@@ -606,7 +608,8 @@ npx wrangler delete d1-tutorial |
606 | 608 | </TabItem> <TabItem label='Dashboard'> |
607 | 609 |
|
608 | 610 | <Steps> |
609 | | -1. Go to **Compute (Workers)** > **Workers & Pages**. |
| 611 | +1. In the Cloudflare dashboard, go to the **Workers & Pages** page. |
| 612 | + <DashButton url="/?to=/:account/workers-and-pages" /> |
610 | 613 |
|
611 | 614 | 2. Select your `d1-tutorial` Worker. |
612 | 615 |
|
|
0 commit comments