Files
supervisor-ui/app/api/supervisor/processes/start-all/route.ts

19 lines
574 B
TypeScript
Raw Normal View History

import { NextRequest, NextResponse } from 'next/server';
import { createSupervisorClient } from '@/lib/supervisor/client';
import { withLogging } from '@/lib/utils/api-logger';
export const POST = withLogging(async (request: NextRequest) => {
const body = await request.json().catch(() => ({}));
const wait = body.wait ?? true;
const client = createSupervisorClient();
const results = await client.startAllProcesses(wait);
return NextResponse.json({
success: true,
message: 'Started all processes',
results,
wait,
});
}, 'startAllProcesses');