import { NextResponse } from "next/server";
import { getAllPosts } from "@/lib/posts";
const SITE_URL = "https://denizbektas.com.tr";
export async function GET() {
const posts = getAllPosts();
const items = posts
.map(
(post) => `
-
${SITE_URL}/${post.category}/${post.slug}
${SITE_URL}/${post.category}/${post.slug}
${new Date(post.date).toUTCString()}
${post.category}
`
)
.join("\n");
const xml = `
Deniz Bektaş — Tüm İçerikler
${SITE_URL}
Siber güvenlik, red team ve kişisel yazılar
tr
${new Date().toUTCString()}
${items}
`;
return new NextResponse(xml, {
headers: {
"Content-Type": "application/xml; charset=utf-8",
"Cache-Control": "public, max-age=3600",
},
});
}