Update README.md

This commit is contained in:
typicode
2015-05-13 06:05:22 +02:00
parent 3dba8eea1d
commit 037b6c3d13

View File

@ -11,10 +11,10 @@ Created with <3 for front-end developers who need a quick back-end for prototypi
Create a `db.json` file
```javascript
```json
{
"posts": [
{ "id": 1, "title": "json-server" }
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
@ -30,8 +30,8 @@ $ json-server db.json
Now if you go to [http://localhost:3000/posts/1](), you'll get
```javascript
{ "id": 1, "title": "json-server" }
```json
{ "id": 1, "title": "json-server", "author": "typicode" }
```
Also, if you make POST, PUT, PATCH or DELETE requests, changes will be automatically saved to `db.json` using [lowdb](https://github.com/typicode/lowdb).