-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrangler.toml.example
More file actions
57 lines (47 loc) · 1.28 KB
/
wrangler.toml.example
File metadata and controls
57 lines (47 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name = "url-shortener"
main = "src/api/worker.ts"
compatibility_date = "2025-06-01"
# Custom domain (change to your domain)
routes = [
{ pattern = "your-domain.com", custom_domain = true },
{ pattern = "www.your-domain.com", custom_domain = true }
]
# Static assets (React build output)
[assets]
directory = "dist"
binding = "ASSETS"
html_handling = "none"
not_found_handling = "none"
# D1 Database binding
# Create with: wrangler d1 create url-shortener-db
[[d1_databases]]
binding = "DB"
database_name = "url-shortener-db"
database_id = "YOUR_D1_DATABASE_ID"
# KV Namespace binding (for caching)
# Create with: wrangler kv:namespace create CACHE
[[kv_namespaces]]
binding = "CACHE"
id = "YOUR_KV_NAMESPACE_ID"
# Scheduled worker for cleanup (runs daily at midnight UTC)
[triggers]
crons = ["0 0 * * *"]
# Environment variables (production)
[vars]
URL_EXPIRY_DAYS = "14"
RATE_LIMIT_PER_MINUTE = "10"
RATE_LIMIT_PER_DAY = "100"
# Development environment - unlimited rate limits
[env.dev]
name = "url-shortener-dev"
[env.dev.vars]
URL_EXPIRY_DAYS = "14"
RATE_LIMIT_PER_MINUTE = "999999"
RATE_LIMIT_PER_DAY = "999999"
[[env.dev.d1_databases]]
binding = "DB"
database_name = "url-shortener-db"
database_id = "YOUR_D1_DATABASE_ID"
[[env.dev.kv_namespaces]]
binding = "CACHE"
id = "YOUR_KV_NAMESPACE_ID"