4c7cc26281
api/ (ElysiaJS+Bun WS gateway skeleton), worker/ (Rust, Redis dirty-chunk stream consumer behind a swappable RenderBackend trait), frontend/ (ElysiaJS+Pug+Tailwind4+Alpine, one server-rendered page) — all three verified running locally. docker-compose wires them up with postgres, redis, minio (rendered tile/mesh object storage), and Caddy as reverse proxy.
22 lines
707 B
TypeScript
22 lines
707 B
TypeScript
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}`);
|