以前のリビジョンの文書です
モック用のAPIサーバーが簡単に作成できる。
// 1.ディレクトリ作成 $ mkdir jsonsever $ cd jsonserver // 2.グローバルインストール $ npm install -g json-server // 3.レスポンス元となるjsonファイル作成 // /jsonserver/db.json { "users": [ { "id": 1, "name": "safa"}, { "id": 2, "name": "hana"} ] } // 4.json-serverを実行する >json-server --watch db.json \{^_^}/ hi! Loading db.json Done Resources http://localhost:3000/users Home http://localhost:3000 Type s + enter at any time to create a snapshot of the database Watching... // 5.http://localhost:3000にアクセスするだけ