feat: bootstrap vela UI and gateway workspace
Establish the monorepo, tooling, and starter apps so UI and gateway development can begin from a documented, runnable baseline.
This commit is contained in:
9
apps/vela-gateway/README.md
Normal file
9
apps/vela-gateway/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# vela-gateway
|
||||
|
||||
This workspace contains the Vela gateway service as a minimal Fastify app.
|
||||
|
||||
Current status:
|
||||
|
||||
- Fastify server boots in the Yarn workspace
|
||||
- `/` and `/health` endpoints provide a runnable service baseline
|
||||
- WebSocket session orchestration remains a later increment
|
||||
14
apps/vela-gateway/package.json
Normal file
14
apps/vela-gateway/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "vela-gateway",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"description": "Minimal Fastify app for the Vela gateway service.",
|
||||
"scripts": {
|
||||
"dev": "node --watch src/index.js",
|
||||
"start": "node src/index.js",
|
||||
"build": "node -e \"console.log('vela-gateway: no build step required')\""
|
||||
},
|
||||
"dependencies": {
|
||||
"fastify": "^5.2.1"
|
||||
}
|
||||
}
|
||||
37
apps/vela-gateway/src/index.js
Normal file
37
apps/vela-gateway/src/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
const Fastify = require('fastify');
|
||||
|
||||
function buildServer() {
|
||||
const app = Fastify({ logger: true });
|
||||
|
||||
app.get('/', async () => ({
|
||||
service: 'vela-gateway',
|
||||
status: 'ok',
|
||||
transport: 'http',
|
||||
next: 'websocket session skeleton'
|
||||
}));
|
||||
|
||||
app.get('/health', async () => ({ status: 'ok' }));
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
async function start() {
|
||||
const app = buildServer();
|
||||
const port = Number(process.env.PORT ?? 3001);
|
||||
const host = process.env.HOST ?? '0.0.0.0';
|
||||
|
||||
try {
|
||||
await app.listen({ port, host });
|
||||
} catch (error) {
|
||||
app.log.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
start();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
buildServer
|
||||
};
|
||||
Reference in New Issue
Block a user