// Deploys the built Vite app (dist/) as an assets-only Cloudflare Worker. // No server-side code — this is purely static hosting for app.diagrav.com. // Build first (with the right VITE_* env vars baked in for the target // environment — see the CI/CD section of deployment-plan.md), then: // npx wrangler deploy --config wrangler.app.jsonc (production) // npx wrangler deploy --config wrangler.app.jsonc --env staging { "$schema": "./node_modules/wrangler/config-schema.json", "name": "diagrav-app", "compatibility_date": "2026-09-25", "assets": { "directory": "./dist", "not_found_handling": "single-page-application" }, "routes": [ { "pattern": "app.diagrav.com", "custom_domain": true } ], // Own Worker, own route, own build (with staging's VITE_SUPABASE_* baked // in) — never shares runtime state with production. `assets.directory` // isn't overridable per-environment in Wrangler, which is fine here: it's // the same dist/ folder either way, just rebuilt with different env vars // immediately before each deploy. "env": { "staging": { "name": "diagrav-app-staging", "routes": [ { "pattern": "staging-app.diagrav.com", "custom_domain": true } ] } } }