import { type NextRequest, NextResponse } from "next/server"
import { getFlags } from "@/lib/flags"

/**
 * GET /api/flags
 * Returns current feature flag configuration
 */
export async function GET(request: NextRequest): Promise<NextResponse> {
  try {
    const flags = getFlags()
    return NextResponse.json({ flags })
  } catch (error) {
    console.error("[flags] Error loading flags:", error)
    return NextResponse.json(
      { error: "Failed to load feature flags" },
      { status: 500 }
    )
  }
}
