Phase 02: Go Playground proxy infrastructure
Issue #3 · open
Part of #1.
What this phase delivers
A working POST /api/compile path in dev (Vite proxy) and prod (server/ Express app) proxying to https://play.golang.org/compile, plus Dockerfile and deployment notes.
Scope
- Vite dev proxy in
vite.config.ts:/api/compile→https://play.golang.org/compile, preserving form-encoding. server/package.json+server/src/index.ts: Express app withPOST /api/compile. Default port8787.PLAYGROUND_UPSTREAMenv var (defaulthttps://play.golang.org/compile).server/Dockerfile(Node 20-alpine).- Smoke test (shell or vitest):
curlpostingversion=2&body=...&withVet=truereturnsErrors/Events/Status. - README: "Deploying the proxy" with Fly.io and Render snippets.
Acceptance criteria
- [ ]
/api/compilefrom dev returns Playground JSON for a valid program. - [ ]
cd server && pnpm devruns prod proxy on:8787; same curl works. - [ ]
docker build server/succeeds and the container runs. - [ ]
PLAYGROUND_UPSTREAMoverride works (point at a mock and verify). - [ ] Upstream errors surface unmodified.
Dependencies
Out of scope
- Caching, rate limiting, auth — explicitly excluded.
Decision references
D2.1–D2.5.
Estimate: 5–7h.