// Worker principal para "Belleville" export default { async fetch(request, env, ctx) { const url = new URL(request.url); // 1. API: Obtener el estado actual de la ciudad if (url.pathname === "/api/map") { // En el futuro, esto leerá de Cloudflare D1 o KV. // Por ahora, simulamos un mapa donde el centro (5x5) está ocupado // y la periferia (3 calles más) tiene lotes disponibles. const cityGrid = { name: "Belleville", coreSize: 5, expansionRings: 3, constructions: [ { id: "church_01", x: 0, z: 0, type: "core_permanent", rotation: 0 }, // Centro { id: "bar_classic", x: 1, z: -1, type: "core_permanent", rotation: 90 } ] }; return new Response(JSON.stringify(cityGrid), { headers: { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*" } }); } // 2. Servir la interfaz visual (HTML + HTML5 Canvas con Three.js) return new Response(htmlInterface, { headers: { "Content-Type": "text/html" } }); } }; // Interfaz visual mínima que el Worker enviará al navegador const htmlInterface = ` Belleville - Flyby View

Belleville

Use left-click to orbit | Right-click to pan | Scroll to zoom

Network: Stellar XLM Economy Ready

`;