Created
November 27, 2015 05:25
-
-
Save hackugyo/09cb358bca437f0788a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ json-server --watch db.json | |
| http://qiita.com/yhikishima/items/46860ffc48913182a3ee | |
| # ルーティングのためのキーが必要になる。listというところを空にするとオチる | |
| $ json-server --watch db.json # 起動 | |
| $ http -v POST localhost:3000/list < ~/git/json_server/data.json # data.jsonをPOST | |
| # POSTするとモックJSONサーバの内部状態が変化する | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "fuga" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "list": [ | |
| { | |
| "id": 1, | |
| "name": "yamada", | |
| "gender": "M" | |
| }, | |
| { | |
| "id": 2, | |
| "name": "satou", | |
| "gender": "W" | |
| }, | |
| { | |
| "id": 3, | |
| "name": "tanaka", | |
| "gender": "M" | |
| }, | |
| { | |
| "id": 4 | |
| }, | |
| { | |
| "name": "fuga", | |
| "id": 5 | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment