【发布时间】:2021-08-31 14:42:10
【问题描述】:
我正在尝试通过我的浏览器访问以查看我从我的 json 数据库中获得了什么。
这是一个例子:
{
"records": [
{
"data": {
"Identification number": "34",
"Name": "Joqmo",
"Gender": "female",
"Risk": "BITES",
"Hair length": "6.2000000000",
"IQ": "98",
"Admission date": "Mon Dec 13 00:00:00 CET 1993",
"Last breakdown": "Wed Dec 24 07:14:50 CET 2014",
"Yearly fee": "67035",
"Knows the Joker?": "true"
},
"kids": {
"has_relatives": {
"records": [
{
"data": {
"Relative ID": "1007",
"Patient ID": "34",
"Is alive?": "true",
"Frequency of visits": "29"
},
"kids": {
"has_phone": {
"records": [
{
"data": {
"Phone ID": "2008",
"ID of the relative": "1007",
"Phone": "+(179)-982-0570"
},
"kids": {}
}
]
}
}
}
]
}
}
}
}
]
}
然后我可以访问localhost:5000/records,所有信息都完美显示。
但是当尝试访问更深的级别时,localhost:5000/records/0 是数组中的第一个元素,我应该能够在第一级看到“数据”和“孩子”,但它发送了 404。
有什么想法吗???
【问题讨论】:
标签: json-server