Local development
Prerequisites
Section titled “Prerequisites”- Node.js 20+
- Corepack enabled
- Yarn 4 (repo standard)
Standard app loop
Section titled “Standard app loop”From repo root:
yarn installyarn workspace cosmos-digital-services devDefault local URL is typically http://localhost:4321.
Useful local commands
Section titled “Useful local commands”yarn workspace cosmos-digital-services lintyarn workspace cosmos-digital-services test:unityarn workspace cosmos-digital-services test:e2eOptional worker development loops
Section titled “Optional worker development loops”From repo root:
yarn workspace cosmos-digital-services worker:dev:gatewayyarn workspace cosmos-digital-services worker:dev:imageThese commands run Wrangler dev using:
workers/wrangler.gateway.tomlworkers/wrangler.image.toml
Environment setup reminders
Section titled “Environment setup reminders”- App/browser variables go in app
.env(see Environment variables). - Worker-only variables live in Wrangler config and env blocks.
- For auth-related testing, ensure Access and verify endpoint configuration align with your target environment.
Troubleshooting quick hits
Section titled “Troubleshooting quick hits”- Session endpoint returning HTML locally usually means worker route/config mismatch for that host.
- Unexpected maintenance page rewrite: check
PUBLIC_MAINTENANCE_MODE. - Browser fetch blocked: verify CSP in
public/_headers.