修复随机文章
This commit is contained in:
@@ -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',
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user