stock-bot/apps/data-services/feature-store/src/index.ts

41 lines
1.2 KiB
TypeScript

import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { logger } from 'hono/logger';
// Controllers
import { HealthController } from './controllers/HealthController';
const app = new Hono();
// Middleware
app.use('*', cors());
app.use('*', logger());
// Initialize logger for services
const appLogger = { info: console.log, error: console.error, warn: console.warn, debug: console.log };
// Controllers
const healthController = new HealthController(appLogger);
// Health endpoints
app.get('/health', healthController.getHealth.bind(healthController));
app.get('/health/readiness', healthController.getReadiness.bind(healthController));
app.get('/health/liveness', healthController.getLiveness.bind(healthController));
// API endpoints will be implemented as services are completed
app.get('/api/v1/feature-groups', async (c) => {
return c.json({ message: 'Feature groups endpoint - not implemented yet' });
});
app.post('/api/v1/feature-groups', async (c) => {
return c.json({ message: 'Create feature group endpoint - not implemented yet' });
});
const port = process.env.PORT || 3003;
console.log(`Feature Store service running on port ${port}`);
export default {
port,
fetch: app.fetch,
};