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:
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