export async function POST(req: Request) {↵// 导出 POST 异步处理函数,接收 Request 对象
const body = await req.json();↵// 解析请求体中的 JSON 数据
const result = await prisma.post.create({↵// 用 Prisma 创建新的 post 记录
data: { title: body.title, content: body.content },↵// data 对象指定要写入的字段值
});↵// Prisma create 调用结束
return Response.json(result);↵// 将创建结果以 JSON 格式返回
}// 函数结束