Files
Codeman/src/web/routes/team-routes.ts
T
arkonandClaude Opus 4.6 e05d507254 refactor: extract server.ts routes into domain modules (phase 3)
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>
2026-02-28 19:12:45 +01:00

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) };
});
}