-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrangler.api.toml
More file actions
81 lines (67 loc) · 2.44 KB
/
wrangler.api.toml
File metadata and controls
81 lines (67 loc) · 2.44 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# ==============================================================================
# SOLAR MINING CALCULATOR - MODULAR WORKER ARCHITECTURE
# ==============================================================================
#
# This configuration defines a modular Worker architecture with clear separation
# of concerns for maintainability and scalability:
#
# 1. Main API Worker (this file) - UI interactions, CRUD operations, routing
# 2. Calculation Worker - Heavy computational tasks, projections, simulations
# 3. Data Worker - External API calls, data fetching, caching
# 4. Frontend - React app deployed to Cloudflare Pages
#
# Benefits:
# - Independent scaling and resource allocation
# - Isolated failure domains (API failures don't affect calculations)
# - Optimized performance per service type
# - Easier maintenance and deployment
# ==============================================================================
# MAIN API WORKER - Primary application server
name = "solar-mining-api"
main = "src/server/api/index.ts"
compatibility_date = "2024-01-01"
compatibility_flags = ["nodejs_compat"]
# Development environment
[env.development]
name = "solar-mining-api-dev"
# Production environment
[env.production]
name = "solar-mining-api"
# Database bindings - Main API Worker handles all database operations
[[env.development.d1_databases]]
binding = "DB"
database_name = "solar-mining-db-dev"
database_id = "435d8973-cd30-4d83-bb9f-a37c09190695"
[[env.production.d1_databases]]
binding = "DB"
database_name = "solar-mining-db"
database_id = "6967c156-01e7-4469-b331-69a33240c796"
# Service bindings - Connect to other Workers
[[env.development.services]]
binding = "CALCULATIONS"
service = "solar-mining-calculations-dev"
[[env.development.services]]
binding = "DATA_SERVICE"
service = "solar-mining-data-dev"
[[env.production.services]]
binding = "CALCULATIONS"
service = "solar-mining-calculations"
[[env.production.services]]
binding = "DATA_SERVICE"
service = "solar-mining-data"
# Analytics for monitoring API usage (disabled for initial deployment)
# [[env.production.analytics_engine_datasets]]
# binding = "ANALYTICS"
# dataset = "solar_mining_api_analytics"
# API Worker environment variables
[env.development.vars]
CORS_ORIGIN = "http://localhost:3000"
API_VERSION = "v1"
[env.production.vars]
CORS_ORIGIN = "https://solar-mining-calculator.pages.dev"
API_VERSION = "v1"
# CPU limits disabled for free plan
# [limits]
# cpu_ms = 50
[observability]
enabled = true