Skip to content

Commit 860b4e5

Browse files
Muhammad-Bin-AliMuhammad Ali
andauthored
Fix preview URL localhost format and token character spec (#28540)
Co-authored-by: Muhammad Ali <muhammadali@cloudflare.com>
1 parent 700c6ba commit 860b4e5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/content/docs/sandbox/concepts/preview-urls.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ const exposed = await sandbox.exposePort(8000, { hostname });
2020

2121
console.log(exposed.url);
2222
// Production: https://8000-sandbox-id-abc123random4567.yourdomain.com
23-
// Local dev: http://localhost:8787/...
23+
// Local dev: http://8000-sandbox-id-abc123random4567.localhost:{port}/
2424
```
2525

2626
## URL Format
2727

2828
**Production**: `https://{port}-{sandbox-id}-{token}.yourdomain.com`
2929

3030
- With auto-generated token: `https://8080-abc123-random16chars12.yourdomain.com`
31-
- With custom token: `https://8080-abc123-my-api-v1.yourdomain.com`
31+
- With custom token: `https://8080-abc123-my_api_v1.yourdomain.com`
3232

33-
**Local development**: `http://localhost:8787/...`
33+
**Local development**: `http://{port}-{sandbox-id}-{token}.localhost:{dev-server-port}`
3434

3535
## Token Types
3636

@@ -52,15 +52,15 @@ For production deployments or shared URLs, specify a custom token to maintain co
5252
```typescript
5353
const stable = await sandbox.exposePort(8000, {
5454
hostname,
55-
token: 'api-v1'
55+
token: 'api_v1'
5656
});
57-
// https://8000-sandbox-id-api-v1.yourdomain.com
57+
// https://8000-sandbox-id-api_v1.yourdomain.com
5858
// Same URL every time ✓
5959
```
6060

6161
**Token requirements:**
6262
- 1-16 characters long
63-
- Lowercase letters (a-z), numbers (0-9), hyphens (-), and underscores (_) only
63+
- Lowercase letters (a-z), numbers (0-9), and underscores (_) only
6464
- Must be unique within each sandbox
6565

6666
**Use cases for custom tokens:**

0 commit comments

Comments
 (0)