Skip to content

Commit b4f7e53

Browse files
committed
WIP
1 parent 3ba931c commit b4f7e53

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,32 @@ You must press enter after you input your Application domain for it to save. You
6060

6161
6. Go to the next page.
6262
7. Add a name for your access policy (for example, "Allow employees access to preview URLs for my-worker").
63-
8. In the **Configure rules** section create a new rule with the **Emails** selector, or any other attributes which you wish to gate access to previews with.
63+
8. In the **Configure rules** section create a new rule with the **Emails** selector, or any other attributes which you wish to gate access to previews with.
6464
9. Enter the emails you want to authorize. View [access policies](/cloudflare-one/policies/access/#selectors) to learn about configuring alternate rules.
6565
10. Go to the next page.
6666
11. Add application.
6767

6868
## Making Preview URLs inaccessible
6969

70-
Preview URLs run on your [`workers.dev` subdomain](/workers/configuration/routing/workers-dev/). To make preview URLs inaccessible, you must disable your Workers `workers.dev` subdomain. Learn how to [disable your Workers `workers.dev` subdomain](/workers/configuration/routing/workers-dev/#disabling-workersdev).
70+
Preview URLs run on your [`workers.dev` subdomain](/workers/configuration/routing/workers-dev/). You can disable preview URLs to make them inaccessible.
71+
72+
### Disable on the Cloudflare dashboard
73+
74+
TODO: Not finished this yet
75+
76+
### Disable in Wrangler
77+
78+
In your `wrangler.toml` you can add `preview_urls = false` to disable preview URLs from generating and being accessible.
79+
80+
```toml
81+
name = "my-worker"
82+
compatibility_date = "2024-01-01"
83+
preview_urls = false
84+
```
7185

7286
## Limitations
7387

7488
- Preview URLs are not generated for Workers that implement a [Durable Object](/durable-objects/).
7589
- Preview URLs are not currently generated for [Workers for Platforms](/cloudflare-for-platforms/workers-for-platforms/) [user Workers](/cloudflare-for-platforms/workers-for-platforms/reference/how-workers-for-platforms-works/#user-workers). This is a temporary limitation, we are working to remove it.
7690
- You cannot currently configure Preview URLs to run on a subdomain other than [`workers.dev`](/workers/configuration/routing/workers-dev/).
91+
- You cannot use `wrangler tail`, [Workers Logs](/workers/observability/logs/workers-logs) or other similar tools to view logs for preview URLs.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ At a minimum, the `name`, `main` and `compatibility_date` keys are required to d
108108

109109
- Enables use of `*.workers.dev` subdomain to test and deploy your Worker. If you have a Worker that is only for `scheduled` events, you can set this to `false`. Defaults to `true`.
110110

111+
- `preview_urls` <Type text="boolean" /> <MetaInfo text="optional" />
112+
113+
- Enables use of `*<worker-name>.workers.dev` previews to test versions of your Worker. Defaults to `true`.
114+
111115
- `route` <Type text="Route" /> <MetaInfo text="optional" />
112116

113117
- A route that your Worker should be deployed to. Only one of `routes` or `route` is required. Refer to [types of routes](#types-of-routes).
@@ -345,7 +349,6 @@ enabled = true
345349
head_sampling_rate = 0.1 # 10% of requests are logged
346350
```
347351

348-
349352
## Custom builds
350353

351354
You can configure a custom build step that will be run before your Worker is deployed. Refer to [Custom builds](/workers/wrangler/custom-builds/).

0 commit comments

Comments
 (0)