initial data-ingestion refactor

This commit is contained in:
Boki 2025-06-21 15:18:25 -04:00
parent 09d907a10c
commit 4f89affc2b
19 changed files with 309 additions and 549 deletions

View file

@ -0,0 +1,27 @@
import { Hono } from 'hono';
import type { ServiceContainer } from '@stock-bot/connection-factory';
import { exchangeRoutes } from './exchange.routes';
import { healthRoutes } from './health.routes';
import { queueRoutes } from './queue.routes';
/**
* Creates all routes with access to the service container
*/
export function createRoutes(container: ServiceContainer): Hono {
const app = new Hono();
// Mount routes that don't need container
app.route('/health', healthRoutes);
// TODO: Update these routes to use container when needed
app.route('/api/exchanges', exchangeRoutes);
app.route('/api/queue', queueRoutes);
// Store container in app context for handlers that need it
app.use('*', async (c, next) => {
c.set('container', container);
await next();
});
return app;
}