import { NextResponse } from 'next/server';
import { isSetupRequired } from '@/lib/setup/detection';
import { canConnect } from '@/lib/postgres/client';

export async function GET() {
  const [required, dbReachable] = await Promise.all([
    isSetupRequired().catch(() => true),
    canConnect().catch(() => false),
  ]);

  return NextResponse.json({ required, dbReachable });
}
