import { Elysia } from "elysia"; // Phase 0 skeleton: health check + a bare WS gateway endpoint that mod instances will // eventually authenticate against with a per-server token (see plan's "WS Gateway" module). // Delta/chat/link-request routing lands in Phase 1+. const app = new Elysia() .get("/health", () => ({ status: "ok" })) .ws("/ws", { open(ws) { console.log(`[ws] connection opened: ${ws.id}`); }, message(ws, message) { console.log(`[ws] message from ${ws.id}:`, message); }, close(ws) { console.log(`[ws] connection closed: ${ws.id}`); }, }) .listen(Number(process.env.PORT ?? 3000)); console.log(`[api] listening on :${app.server?.port}`);