const getAllModels = async () => { const response = await fetch("https://lorastudio.co/api/models/sitemap", { method: "GET", headers: { "Content-Type": "application/json" } }) const models = await response.json() return models.cards }; export async function GET() { const models = await getAllModels() return new Response( ` https://lorastudio.co/ ${new Date().toISOString()} ${models .map( (model) => ` https://lorastudio.co/models/${model.id} ${new Date(model.createdAt).toISOString()} ` ) .join("")} `.trim(), { headers: { 'Content-Type': 'application/xml' } } ); }