import { NextRequest, NextResponse } from "next/server"; export async function POST(req: NextRequest) { try { const body = await req.json(); const response = await fetch( "http://127.0.0.1:8000/run-systemforge", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(body), } ); const data = await response.json(); return NextResponse.json(data, { status: response.status, }); } catch (error) { return NextResponse.json( { error: "Internal server error", }, { status: 500, } ); } }