import { getApiSettings, saveApiSettings } from "@/lib/server/app-settings"; import { jsonError, jsonOk, readJsonBody } from "@/lib/server/api"; export const runtime = "nodejs"; export async function GET() { try { return jsonOk(await getApiSettings()); } catch (error) { return jsonError(error, 500); } } export async function POST(request: Request) { try { const body = await readJsonBody<{ values?: Record }>(request); return jsonOk(await saveApiSettings(body.values || {})); } catch (error) { return jsonError(error, 500); } }