mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 08:29:42 +02:00
Split 6,710-line server.ts into focused route modules using port interfaces for dependency injection. 107/109 routes extracted into 12 domain files with auth middleware, 5 port interfaces, and shared helpers. Server.ts retains orchestration (SSE, lifecycle, state). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
577 B
TypeScript
19 lines
577 B
TypeScript
/**
|
|
* @fileoverview Team routes.
|
|
* Provides read-only access to agent team data from TeamWatcher.
|
|
*/
|
|
|
|
import { FastifyInstance } from 'fastify';
|
|
import type { InfraPort } from '../ports/index.js';
|
|
|
|
export function registerTeamRoutes(app: FastifyInstance, ctx: InfraPort): void {
|
|
app.get('/api/teams', async () => {
|
|
return { success: true, data: ctx.teamWatcher.getTeams() };
|
|
});
|
|
|
|
app.get('/api/teams/:name/tasks', async (req) => {
|
|
const { name } = req.params as { name: string };
|
|
return { success: true, data: ctx.teamWatcher.getTeamTasks(name) };
|
|
});
|
|
}
|