Pular para o conteúdo

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 PatternTargetPort
/api/auth/*auth-worker8788
/api/billing/*billing-worker8789
/api/listings*listings-worker8790
/api/chat/*chat-worker8787
/api/wschat-worker8787
/api/search*chat-worker8787
All other /api/*chat-worker8787
Everything elsesite/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 /_headers and _redirects files in site/public/ control caching and redirects

Scope Aliases

For backward compatibility, the generator produces dual output:

Primary PathAlias 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.