Urara-Blog/src/routes/posts.json.ts
Sevichecc 330de1dee2 init
2022-08-01 13:50:59 +08:00

9 lines
266 B
TypeScript

import type { RequestHandler } from '@sveltejs/kit'
import { genPosts } from '$lib/utils/posts'
export const GET: RequestHandler = async () => ({
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
body: JSON.stringify(genPosts(), null, 2)
})