- Add worker-api/ with TypeScript + Wrangler setup - D1 database schema (bots, matches, jobs, rating_history) - Glicko-2 rating system implementation with unit tests - Job coordination endpoints (claim, heartbeat, result, fail) - Bot management endpoints (register, list, update, rotate-key) - Cron handlers (matchmaker, health checker, stale job reaper) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
533 B
TOML
23 lines
533 B
TOML
name = "acb-api"
|
|
main = "src/index.ts"
|
|
compatibility_date = "2025-03-10"
|
|
compatibility_flags = ["nodejs_compat"]
|
|
|
|
[[d1_databases]]
|
|
binding = "DB"
|
|
database_name = "acb-db"
|
|
database_id = "placeholder-will-be-set-on-deploy"
|
|
|
|
[vars]
|
|
ENVIRONMENT = "development"
|
|
|
|
[triggers]
|
|
crons = [
|
|
"*/1 * * * *", # Matchmaker: every minute
|
|
"*/5 * * * *", # Stale job reaper: every 5 minutes
|
|
"*/15 * * * *" # Health checker: every 15 minutes
|
|
]
|
|
|
|
# API key for worker authentication (set via wrangler secret put API_KEY)
|
|
# [secrets]
|
|
# API_KEY
|