API 测试页面

这个页面用于测试我们实现的 Cloudflare Pages Functions API 接口。

Hello API (GET)

GET /api/hello

Hello API (POST)

POST /api/hello
Request Body:
{
  "message": "Test from client"
}

Time API

GET /api/time

Get User #1

GET /api/user/1

Get User #999

GET /api/user/999

Posts List

GET /api/posts

Create New Post

POST /api/posts
Request Body:
{
  "title": "测试文章",
  "content": "这是一篇测试文章的内容...",
  "author": "Test User"
}

API 文档

GET /api/hello - 简单的问候接口
POST /api/hello - 支持 POST 数据的问候接口
GET /api/time - 获取服务器时间
GET /api/user/[id] - 获取用户信息
GET /api/posts - 获取文章列表
POST /api/posts - 创建新文章