I am using json-server
to push json data as REST api.
Server returns (above) for get request like this:
http://localhost:3000/items?itemid=534
return:
[
{
"itemid": 534,
"type": "textcontent",
"icon": "http://exampple.com/1png",
"title": "John",
"description": "Description",
"url": "http://example.net/project/doSomething"
}
]
return is JSON array
, but not JSON object
.
What should i do, to return json object
Data file is: data.json
{
"items": [
{
"itemid": 534,
"type": "textcontent",
"icon": "http://exampple.com/1png",
"title": "John",
"description": "Description",
"url": "http://example.net/project/doSomething"
},
{
"itemid": 234,
"type": "textcontent",
"icon": "http://exampple.com/2png",
"title": "Smith",
"description": "Description2",
"url": "http://example.net/project/doSomething2"
}
]
}