import { NextResponse } from 'next/server';

const AI_LAWYER_RAG_URL = process.env.AI_LAWYER_RAG_URL || 'http://localhost:5007';

export async function GET() {
  try {
    const res = await fetch(`${AI_LAWYER_RAG_URL}/analytics`);
    const data = await res.json();
    return NextResponse.json(data);
  } catch (error) {
    return NextResponse.json({ error: 'Analytics service unavailable' }, { status: 503 });
  }
}
