Phase 0: scaffold three-service backend (api/worker/frontend)
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.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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}`);
|
||||
Reference in New Issue
Block a user