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

19 lines
572 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.stopAllProcesses(wait);
return NextResponse.json({
success: true,
message: 'Stopped all processes',
results,
wait,
});
}, 'stopAllProcesses');