修复随机文章

This commit is contained in:
biss committed 2026-06-18 20:36:03 +08:00
1 parent 41854a128d
commit 7dc7cd9e73
2 files changed
+35 -12

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import { getAllPosts } from '@/lib/posts';
export function GET() {
const posts = getAllPosts().map((post) => ({
title: post.title,
href: post.href,
}));
return new Response(JSON.stringify(posts), {
headers: {
'content-type': 'application/json; charset=utf-8',
},
});
}