initial data-ingestion refactor
This commit is contained in:
parent
09d907a10c
commit
4f89affc2b
19 changed files with 309 additions and 549 deletions
27
apps/data-ingestion/src/routes/create-routes.ts
Normal file
27
apps/data-ingestion/src/routes/create-routes.ts
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue