feat(protocol): add shared WebSocket contract package

This commit is contained in:
2026-04-08 18:15:31 +02:00
parent ffab815f6b
commit 4fd27db11e
10 changed files with 286 additions and 26 deletions

View File

@@ -1,4 +1,9 @@
const Fastify = require('fastify');
const {
CLIENT_EVENT_TYPES,
PROTOCOL_PACKAGE_NAME,
SERVER_EVENT_TYPES
} = require('@vela/protocol');
function buildServer() {
const app = Fastify({ logger: true });
@@ -7,7 +12,12 @@ function buildServer() {
service: 'vela-gateway',
status: 'ok',
transport: 'http',
next: 'websocket session skeleton'
next: 'websocket session skeleton',
protocol: {
package: PROTOCOL_PACKAGE_NAME,
clientEventCount: CLIENT_EVENT_TYPES.length,
serverEventCount: SERVER_EVENT_TYPES.length
}
}));
app.get('/health', async () => ({ status: 'ok' }));