import { NextResponse } from 'next/server' import { readFileSync, existsSync } from 'fs' import path from 'path' export interface VinylShape { name: string variationId: string priceCents: number } export interface VinylFont { id: string name: string family: string } export interface VinylConfig { vinylItemId: string vinylVariationId: string pricePerLetterCents: number maxCharacters: number shapeItemId: string shapes: VinylShape[] fonts: VinylFont[] } const CONFIG_PATH = path.join(process.cwd(), 'data', 'vinyl-config.json') export async function GET() { if (!existsSync(CONFIG_PATH)) { return NextResponse.json({ error: 'Vinyl config not found' }, { status: 404 }) } try { const config: VinylConfig = JSON.parse(readFileSync(CONFIG_PATH, 'utf-8')) return NextResponse.json(config) } catch { return NextResponse.json({ error: 'Failed to load vinyl config' }, { status: 500 }) } }