|
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,11 @@ 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. <DashButton url="/?to=/:account/workers-and-pages" /> |
| 93 | +2. Select **Create application**. |
| 94 | +3. Select **Start with Hello World!** > **Get started**. |
| 95 | +4. Name your Worker. For this tutorial, name your Worker `d1-tutorial`. |
| 96 | +5. Select **Deploy**. |
98 | 97 | </Steps> |
99 | 98 | </TabItem> </Tabs> |
100 | 99 |
|
@@ -148,7 +147,7 @@ This creates a new D1 database and outputs the [binding](/workers/runtime-apis/b |
148 | 147 | </TabItem> <TabItem label='Dashboard'> |
149 | 148 |
|
150 | 149 | <Steps> |
151 | | -1. Go to **Storage & Databases** > **D1 SQL Database**. |
| 150 | +1. <DashButton url="/?to=/:account/workers/d1" /> |
152 | 151 | 2. Select **Create Database**. |
153 | 152 | 3. Name your database. For this tutorial, name your D1 database `prod-d1-tutorial`. |
154 | 153 | 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 +215,13 @@ You can also bind your D1 database to a [Pages Function](/pages/functions/). For |
216 | 215 | You create bindings by adding them to the Worker you have created. |
217 | 216 |
|
218 | 217 | <Steps> |
219 | | -1. Go to **Compute (Workers)** > **Workers & Pages**. |
| 218 | +1. <DashButton url="/?to=/:account/workers-and-pages" /> |
220 | 219 | 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**. |
| 220 | +3. Go to the **Bindings** tab. |
| 221 | +4. Select **Add binding**. |
| 222 | +5. Select **D1 database** > **Add binding**. |
224 | 223 | 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 | | - |
| 224 | +7. Select **Add binding**. |
231 | 225 | </Steps> |
232 | 226 |
|
233 | 227 | </TabItem> |
@@ -298,7 +292,7 @@ After correctly preparing your [Wrangler configuration file](/workers/wrangler/c |
298 | 292 | Use the Dashboard to create a table and populate it with data. |
299 | 293 |
|
300 | 294 | <Steps> |
301 | | -1. Go to **Storage & Databases** > **D1 SQL Database**. |
| 295 | +1. <DashButton url="/?to=/:account/workers/d1" /> |
302 | 296 | 2. Select the `prod-d1-tutorial` database you created in [step 2](/d1/get-started/#2-create-a-database). |
303 | 297 | 3. Select **Console**. |
304 | 298 | 4. Paste the following SQL snippet. |
@@ -399,7 +393,7 @@ After configuring your Worker, you can test your project locally before you depl |
399 | 393 | You can query your D1 database using your Worker. |
400 | 394 |
|
401 | 395 | <Steps> |
402 | | -1. Go to **Compute (Workers)** > **Workers & Pages**. |
| 396 | +1. <DashButton url="/?to=/:account/workers-and-pages" /> |
403 | 397 | 2. Select the `d1-tutorial` Worker you created. |
404 | 398 | 3. Select the **Edit code** icon (**\<\/\>**). |
405 | 399 | 4. Clear the contents of the `worker.js` file, then paste the following code: |
@@ -521,7 +515,7 @@ To deploy your Worker to production using Wrangler, you must first repeat the [d |
521 | 515 | </TabItem> <TabItem label='Dashboard'> |
522 | 516 | <Steps> |
523 | 517 |
|
524 | | -1. Go to **Compute (Workers)** > **Workers & Pages**. |
| 518 | +1. <DashButton url="/?to=/:account/workers-and-pages" /> |
525 | 519 | 2. Select your `d1-tutorial` Worker. |
526 | 520 | 3. Select **Deployments**. |
527 | 521 | 4. From the **Version History** table, select **Deploy version**. |
@@ -575,7 +569,7 @@ npx wrangler d1 delete prod-d1-tutorial |
575 | 569 | </TabItem><TabItem label='Dashboard'> |
576 | 570 |
|
577 | 571 | <Steps> |
578 | | -1. Go to **Storages & Databases** > **D1 SQL Database**. |
| 572 | +1. <DashButton url="/?to=/:account/workers/d1" /> |
579 | 573 |
|
580 | 574 | 2. Select your `prod-d1-tutorial` D1 database. |
581 | 575 |
|
@@ -606,7 +600,7 @@ npx wrangler delete d1-tutorial |
606 | 600 | </TabItem> <TabItem label='Dashboard'> |
607 | 601 |
|
608 | 602 | <Steps> |
609 | | -1. Go to **Compute (Workers)** > **Workers & Pages**. |
| 603 | +1. <DashButton url="/?to=/:account/workers-and-pages" /> |
610 | 604 |
|
611 | 605 | 2. Select your `d1-tutorial` Worker. |
612 | 606 |
|
|
0 commit comments