【发布时间】:2015-12-04 07:19:33
【问题描述】:
我正在使用 json-server 创建一个测试 API。我想做 API 端点:http://localhost:3000/posts/1/comments
/posts 和 /posts/1 工作正常,但我不确定为什么 /posts/1/cmets 不能。我错过了什么吗?
这是json
{
"posts": [
{
"id": 1,
"title": "Post 1",
"comments": [
{
"id": 1,
"body": "This is comment 1"
}
]
},
{
"id": 2,
"title": "Post 2",
"comments": []
}
]
}
【问题讨论】: