forked from codechefPesuecc/CodeChef-PESUECC-Chapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
46 lines (43 loc) · 1.85 KB
/
Copy pathwrangler.jsonc
File metadata and controls
46 lines (43 loc) · 1.85 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
{
// Cloudflare deploy config for the Next app via the OpenNext adapter.
// This file is inert for local dev (`npm run dev`) and the Docker judge —
// it only takes effect when building/deploying to Cloudflare. See DEPLOY.md.
"$schema": "node_modules/wrangler/config-schema.json",
"name": "codechef",
"main": ".open-next/worker.js",
"compatibility_date": "2025-03-25",
// Required so node:crypto / node:buffer (auth, hashing) work on Workers.
"compatibility_flags": ["nodejs_compat"],
"assets": {
"directory": ".open-next/assets",
"binding": "ASSETS"
},
// Plain-text runtime config. Require email verification (6-digit OTP) before a
// user can submit — the register flow sends the code and routes to /verify.
// Safe here because the Gmail secrets are configured (see DEPLOY.md §5).
"vars": {
"REQUIRE_EMAIL_VERIFICATION": "true"
},
// --- Database: Cloudflare D1 ---
// src/server/db reads this `DB` binding per request (drizzle-orm/d1 +
// getCloudflareContext). One-time setup:
// 1. npx wrangler d1 create pesuecc-arena → paste the printed database_id below
// 2. npx wrangler d1 migrations apply pesuecc-arena --remote (and --local for dev)
// See DEPLOY.md §2. In `next dev` there's no binding, so the app falls back to
// the local libSQL file automatically — no wrangler needed for dev.
"d1_databases": [
{
"binding": "DB",
"database_name": "pesuecc-arena",
"database_id": "8af7b1c8-c467-4401-86fe-8abd429c35de",
"migrations_dir": "migrations"
}
],
// Workers Logs: capture request logs + errors (viewable in the dashboard under
// the Worker's Observability tab, and via `wrangler tail`). head_sampling_rate
// 1 logs every request — fine at this traffic; lower it if volume grows.
"observability": {
"enabled": true,
"head_sampling_rate": 1
}
}