INNER CODE UNIT · TypeScript
setupAiAgentRoutes
bex-co/beancount-io · backend-cluster/backend-v2/src/features/ai-agent/api/index.ts:17
export function setupAiAgentRoutes(
router: Router,
layers: AppLayers,
config: AppConfig,
): void {
const aiRouter = new Router();
// REST error translation is handled by the outermost restErrorMiddleware in
// the composition root; routes here just throw DomainErrors.
setAgentRoute(aiRouter, layers);
setSandboxAgentRoute(aiRouter, layers, config);
setOpenAIChatCompletionsRoute(aiRouter, layers);
router.use(aiRouter.routes(), aiRouter.allowedMethods());
}