docs: example

This commit is contained in:
typicode
2024-01-26 17:34:15 +01:00
parent a030b6f4a9
commit 38ded8a15b

View File

@ -18,8 +18,8 @@ Create a `db.json` or `db.json5` file
```json ```json
{ {
"posts": [ "posts": [
{ "id": "1", "title": "a title" }, { "id": "1", "title": "a title", "views": 100 },
{ "id": "2", "title": "another title" } { "id": "2", "title": "another title", "views": 200 }
], ],
"comments": [ "comments": [
{ "id": "1", "text": "a comment about post 1", "postId": "1" }, { "id": "1", "text": "a comment about post 1", "postId": "1" },
@ -38,8 +38,8 @@ Create a `db.json` or `db.json5` file
```json5 ```json5
{ {
posts: [ posts: [
{ id: '1', title: 'a title' }, { id: '1', title: 'a title', views: 100 },
{ id: '2', title: 'another title' }, { id: '2', title: 'another title', views: 200 },
], ],
comments: [ comments: [
{ id: '1', text: 'a comment about post 1', postId: '1' }, { id: '1', text: 'a comment about post 1', postId: '1' },
@ -153,9 +153,9 @@ GET /posts?_sort=id,-views
- `x.y.z[i]...` - `x.y.z[i]...`
``` ```
GET /posts?author.name=foo GET /foo?a.b=bar
GET /posts?author.email=foo GET /foo?x.y_lt=100
GET /posts?tags[0]=foo GET /foo?arr[0]=bar
``` ```
### Embed ### Embed