API 参考
完整的 API 文档和使用示例
GET
/api/posts
获取所有已发布的文章
GET
/api/posts/:id
获取单篇文章详情
POST
/api/auth/login
用户登录认证
POST
/api/auth/register
用户注册
快速开始
API 调用示例
example.ts
// Example API request
const response = await fetch('/api/posts', {
headers: {
'Content-Type': 'application/json',
},
});
const posts = await response.json();