You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/get-started/guide.mdx
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,7 @@ This guide will instruct you through setting up and deploying your first Worker.
20
20
21
21
## 1. Create a new Worker project
22
22
23
-
[C3 (`create-cloudflare-cli`)](https://github.com/cloudflare/workers-sdk/tree/main/packages/create-cloudflare) is a command-line tool designed to help you set up and deploy new applications to Cloudflare.
24
-
25
-
Open a terminal window and run C3 to create your Worker project:
23
+
Open a terminal window and run C3 to create your Worker project. [C3 (`create-cloudflare-cli`)](https://github.com/cloudflare/workers-sdk/tree/main/packages/create-cloudflare) is a command-line tool designed to help you set up and deploy new applications to Cloudflare.
26
24
27
25
<PackageManagers
28
26
type="create"
@@ -50,11 +48,11 @@ cd my-first-worker
50
48
51
49
In your project directory, C3 will have generated the following:
52
50
53
-
1.`wrangler.toml`: Your [Wrangler](/workers/wrangler/configuration/#sample-wranglertoml-configuration) configuration file.
54
-
2.`index.js` (in `/src`): A minimal `'Hello World!'` Worker written in [ES module](/workers/reference/migrate-to-module-workers/) syntax.
55
-
3.`package.json`: A minimal Node dependencies configuration file.
56
-
4.`package-lock.json`: Refer to [`npm` documentation on `package-lock.json`](https://docs.npmjs.com/cli/v9/configuring-npm/package-lock-json).
57
-
5.`node_modules`: Refer to [`npm` documentation `node_modules`](https://docs.npmjs.com/cli/v7/configuring-npm/folders#node-modules).
51
+
*`wrangler.toml`: Your [Wrangler](/workers/wrangler/configuration/#sample-wranglertoml-configuration) configuration file.
52
+
*`index.js` (in `/src`): A minimal `'Hello World!'` Worker written in [ES module](/workers/reference/migrate-to-module-workers/) syntax.
53
+
*`package.json`: A minimal Node dependencies configuration file.
54
+
*`package-lock.json`: Refer to [`npm` documentation on `package-lock.json`](https://docs.npmjs.com/cli/v9/configuring-npm/package-lock-json).
55
+
*`node_modules`: Refer to [`npm` documentation `node_modules`](https://docs.npmjs.com/cli/v7/configuring-npm/folders#node-modules).
58
56
59
57
</Details>
60
58
@@ -87,15 +85,15 @@ At a minimum, template folders must contain the following:
87
85
88
86
## 2. Develop with Wrangler CLI
89
87
90
-
The Workers command-line interface, [Wrangler](/workers/wrangler/install-and-update/), allows you to [create](/workers/wrangler/commands/#init), [test](/workers/wrangler/commands/#dev), and [deploy](/workers/wrangler/commands/#deploy) your Workers projects. C3 will install Wrangler in projects by default.
88
+
C3 installs [Wrangler](/workers/wrangler/install-and-update/), the Workers command-line interface, in Workers projects by default. Wrangler lets you to [create](/workers/wrangler/commands/#init), [test](/workers/wrangler/commands/#dev), and [deploy](/workers/wrangler/commands/#deploy) your Workers projects.
91
89
92
90
After you have created your first Worker, run the [`wrangler dev`](/workers/wrangler/commands/#dev) command in the project directory to start a local server for developing your Worker. This will allow you to preview your Worker locally during development.
93
91
94
92
```sh
95
93
npx wrangler dev
96
94
```
97
95
98
-
If you have not used Wrangler before, it will try to open your web browser to login with your Cloudflare account.
96
+
If you have never used Wrangler before, it will open your web browser so you can login to your Cloudflare account.
99
97
100
98
Go to [http://localhost:8787](http://localhost:8787) to view your Worker.
101
99
@@ -191,16 +189,17 @@ If you have not configured any subdomain or domain, Wrangler will prompt you dur
191
189
192
190
Preview your Worker at `<YOUR_WORKER>.<YOUR_SUBDOMAIN>.workers.dev`.
193
191
194
-
<Detailsheader="Encountering errors?">
192
+
<Detailsheader="Seeing 523 errors?">
195
193
196
-
When pushing to your `*.workers.dev` subdomain for the first time, you may see [`523` errors](/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-523-origin-is-unreachable)while DNS is propagating. These errors should resolve themselves after a minute or so.
194
+
If you see [`523` errors](/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-523-origin-is-unreachable)when pushing your `*.workers.dev` subdomain for the first time, wait a minute or so and the errors will resolve themselves.
197
195
198
196
</Details>
199
197
200
198
## Next steps
201
199
202
200
To do more:
203
201
202
+
- Visit the [Cloudlfare dashboard](https://dash.cloudflare.com/) for simpler editing.
204
203
- Review our [Examples](/workers/examples/) and [Tutorials](/workers/tutorials/) for inspiration.
205
204
- Set up [bindings](/workers/runtime-apis/bindings/) to allow your Worker to interact with other resources and unlock new functionality.
206
205
- Learn how to [test and debug](/workers/testing/) your Workers.
0 commit comments