Skip to content

Commit 12c7782

Browse files
committed
Document singular resources
1 parent daf89ae commit 12c7782

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Create a `db.json` file
2020
],
2121
"comments": [
2222
{ "id": 1, "body": "some comment", "postId": 1 }
23-
]
23+
],
24+
"profile": { "name": "typicode" }
2425
}
2526
```
2627

@@ -48,6 +49,8 @@ $ npm install -g json-server
4849

4950
Based on the previous `db.json` file, here are all the default routes. You can also add [other routes](#add-routes) using `--routes`.
5051

52+
Plural resources
53+
5154
```
5255
GET /posts
5356
GET /posts/1
@@ -58,6 +61,15 @@ PATCH /posts/1
5861
DELETE /posts/1
5962
```
6063

64+
Singular resources
65+
66+
```
67+
GET /profile
68+
POST /profile
69+
PUT /profile
70+
PATCH /profile
71+
```
72+
6173
To filter resources (use `.` to access deep properties)
6274

6375
```

0 commit comments

Comments
 (0)