import { NextResponse } from 'next/server'; import { getSession } from '@/lib/session'; import * as phpdb from '@/lib/phpdb'; export async function GET() { const session = await getSession(); if (!session) return NextResponse.json({ error: 'Nicht angemeldet' }, { status: 401 }); try { const rows = await phpdb.getBeos(); return NextResponse.json(rows); } catch (error) { console.error('GET /api/beos:', error); return NextResponse.json({ error: 'Datenbankfehler' }, { status: 500 }); } }