import { NextResponse } from "next/server"
import { getBookStructure } from "@/lib/book-file-system"

export async function GET() {
  try {
    const structure = getBookStructure()
    return NextResponse.json(structure)
  } catch (error) {
    console.error("Error generating menu:", error)
    return NextResponse.json({ error: "Failed to generate menu" }, { status: 500 })
  }
}
