feat(protocol): add shared WebSocket contract package
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
"start": "node src/index.js",
|
||||
"build": "node -e \"console.log('vela-gateway: no build step required')\""
|
||||
},
|
||||
"dependencies": {
|
||||
"fastify": "^5.2.1"
|
||||
}
|
||||
"dependencies": {
|
||||
"@vela/protocol": "0.0.0",
|
||||
"fastify": "^5.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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' }));
|
||||
|
||||
Reference in New Issue
Block a user