Document singular resources

This commit is contained in:
typicode
2015-08-18 01:45:05 +02:00
parent daf89aebda
commit 12c77823fc

View File

@ -20,7 +20,8 @@ Create a `db.json` file
], ],
"comments": [ "comments": [
{ "id": 1, "body": "some comment", "postId": 1 } { "id": 1, "body": "some comment", "postId": 1 }
] ],
"profile": { "name": "typicode" }
} }
``` ```
@ -48,6 +49,8 @@ $ npm install -g json-server
Based on the previous `db.json` file, here are all the default routes. You can also add [other routes](#add-routes) using `--routes`. Based on the previous `db.json` file, here are all the default routes. You can also add [other routes](#add-routes) using `--routes`.
Plural resources
``` ```
GET /posts GET /posts
GET /posts/1 GET /posts/1
@ -58,6 +61,15 @@ PATCH /posts/1
DELETE /posts/1 DELETE /posts/1
``` ```
Singular resources
```
GET /profile
POST /profile
PUT /profile
PATCH /profile
```
To filter resources (use `.` to access deep properties) To filter resources (use `.` to access deep properties)
``` ```