服务状态: 开发中
基础URL: http://localhost:3000
生产URL: https://postapi.kgzivf.com
认证方式: API Key (Header: X-API-Key)
健康检查接口,用于检测服务状态
获取博客文章列表,支持分页、搜索、筛选
查询参数: page, limit, category, tags, status, search
根据ID获取单篇博客文章详情
根据slug获取单篇博客文章详情
创建新的博客文章
更新指定ID的博客文章
删除指定ID的博客文章
批量删除博客文章
批量导入Markdown文档,支持最多50个文件
curl -X GET "http://localhost:3000/api/posts?page=1&limit=10&status=Published"
curl -X POST "http://localhost:3000/api/posts" \
-H "Content-Type: application/json" \
-H "X-API-Key: blog-api-secret-key-2024" \
-d '{
"title": "测试文章",
"slug": "test-article",
"content": "# 测试内容\n\n这是一篇测试文章。",
"summary": "测试文章摘要",
"category": "测试分类",
"tags": ["测试", "API"],
"status": "Published"
}'
{
"id": 1,
"title": "文章标题",
"slug": "article-slug",
"content": "# 文章内容\n\n正文...",
"summary": "文章摘要",
"category": "分类名称",
"tags": ["标签1", "标签2"],
"status": "Published",
"type": "Post",
"created_at": "2023-12-07T10:00:00.000Z",
"updated_at": "2023-12-07T10:00:00.000Z"
}
400 Bad Request: 请求参数错误
401 Unauthorized: 未授权访问(API Key无效)
404 Not Found: 资源不存在
429 Too Many Requests: 请求过于频繁
500 Internal Server Error: 服务器内部错误
详细的API使用说明请参考项目文档。如有问题,请联系开发团队。
项目地址: https://postapi.kgzivf.com
数据库: PostgreSQL
技术栈: Node.js + Express + PostgreSQL