修复随机文章
This commit is contained in:
1 parent
41854a128d
commit
7dc7cd9e73
2 files changed
+35
-12
No files matched your search
@@ -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