Proxy & Routing
Development Proxy
The dev environment uses scripts/dev.js to start all services and route requests through a single proxy on port 3000.
Route Table
| Path Pattern | Target | Port |
|---|---|---|
/api/auth/* | auth-worker | 8788 |
/api/billing/* | billing-worker | 8789 |
/api/listings* | listings-worker | 8790 |
/api/chat/* | chat-worker | 8787 |
/api/ws | chat-worker | 8787 |
/api/search* | chat-worker | 8787 |
All other /api/* | chat-worker | 8787 |
| Everything else | site/public/ | static files |
This means in development, you always talk to http://localhost:3000 and the proxy decides where the request goes.
Production Routing
In production, Cloudflare handles routing at the edge:
- Static assets (HTML, CSS, JS, images) are served from R2 via a Cloudflare Workers script or Pages
- API routes are handled by the appropriate Worker based on URL patterns
- The
/_headersand_redirectsfiles insite/public/control caching and redirects
Scope Aliases
For backward compatibility, the generator produces dual output:
| Primary Path | Alias Path |
|---|---|
/casas/ | /casa-casas/ |
/jardim/ | /casa-jardim/ |
/condominios/ | /casa-condominios/ |
Both paths exist as separate static files. The alias pages contain canonical links pointing to the primary path for SEO.