import { NextResponse } from "next/server";

const LARAVEL = (process.env.NEXT_PUBLIC_API_URL ?? "http://127.0.0.1:8000").replace("/api/v1", "").replace(/\/$/, "");

export async function GET() {
  const res = await fetch(`${LARAVEL}/sitemap.xml`, { next: { revalidate: 3600 } });
  const xml = await res.text();
  return new NextResponse(xml, {
    headers: { "Content-Type": "application/xml" },
  });
}
