b2f9b6c0e9
Markers now carry a caller-supplied x/y/z instead of an auto-resolved terrain height: clicking the map opens a real Leaflet popup pre-filled with the clicked x/z, a default y of 60, and a random color, all editable before saving. The same popup now also opens for editing an existing marker (new updateMarker/PATCH /api/markers/:markerId, TDD'd in markers.test.ts/index.test.ts). Removes the now-unused resolveHeight/GET /api/height machinery. Linked-account markers already synced server-side via the markers table, so cross-device sync falls out of the existing loadMarkers()-on-init flow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015tKdPZt78zbPUZMXWzKEKt
23 lines
1.3 KiB
TypeScript
23 lines
1.3 KiB
TypeScript
import { Elysia } from "elysia";
|
|
import pug from "pug";
|
|
import { join } from "path";
|
|
|
|
// Phase 1: a barebones Leaflet 2D viewer (see public/js/map.js). Phase 2 adds the Babylon 3D
|
|
// viewer (see public/js/mesh.js). Chat box, marker tool, and admin panel land in later phases.
|
|
const renderIndex = pug.compileFile(join(import.meta.dir, "views/index.pug"));
|
|
const renderScene3d = pug.compileFile(join(import.meta.dir, "views/scene3d.pug"));
|
|
|
|
const app = new Elysia()
|
|
.get("/", () => new Response(renderIndex({}), { headers: { "Content-Type": "text/html" } }))
|
|
.get("/3d", () => new Response(renderScene3d({}), { headers: { "Content-Type": "text/html" } }))
|
|
.get("/health", () => ({ status: "ok" }))
|
|
.get("/css/tailwind.css", () => Bun.file(join(import.meta.dir, "public/css/tailwind.css")))
|
|
.get("/js/map.js", () => Bun.file(join(import.meta.dir, "public/js/map.js")))
|
|
.get("/js/coords.js", () => Bun.file(join(import.meta.dir, "public/js/coords.js")))
|
|
.get("/js/colors.js", () => Bun.file(join(import.meta.dir, "public/js/colors.js")))
|
|
.get("/js/mesh.js", () => Bun.file(join(import.meta.dir, "public/js/mesh.js")))
|
|
.get("/js/mesh-format.js", () => Bun.file(join(import.meta.dir, "public/js/mesh-format.js")))
|
|
.listen(Number(process.env.PORT ?? 3001));
|
|
|
|
console.log(`[frontend] listening on :${app.server?.port}`);
|