使用json-server套件快速建置Fake REST API DEMO時會使用這裡的API呈現畫面
- node
^4.5.0
- npm
^3.0.0
先確定好安裝了 node 4.5 以上的版本,接著就可以輸入以下指令
$ git clone https://github.com/ReactMaker/api_server.git
$ cd api_server
$ npm install # Install project dependencies
$ npm start # Compile and launch
如果一切成功,就會看到以下畫面
- 將新的 json 放入 db/ 資料夾內 (必須式陣列型態的)
- 修改 db.js